Skip to content

Commit

Permalink
race fix
Browse files Browse the repository at this point in the history
  • Loading branch information
axiaoxin committed Jul 24, 2021
1 parent 9277a43 commit c37db2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datacenter/sina/keyword_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ func (s Sina) KeywordSearch(ctx context.Context, kw string) (results []SearchRes
logging.Debug(ctx, "Sina KeywordSearch "+apiurl+" begin")
beginTime := time.Now()
resp, err := goutils.HTTPGETRaw(ctx, s.HTTPClient, apiurl)
utf8resp := transcode.FromString(string(resp)).Decode("GBK").ToString()
latency := time.Now().Sub(beginTime).Milliseconds()
logging.Debug(ctx, "Sina KeywordSearch "+apiurl+" end", zap.Int64("latency(ms)", latency), zap.Any("resp", utf8resp))
logging.Debug(ctx, "Sina KeywordSearch "+apiurl+" end", zap.Int64("latency(ms)", latency), zap.Any("resp", string(resp)))
if err != nil {
return nil, err
}
utf8resp := transcode.FromString(string(resp)).Decode("GBK").ToString()
ds := strings.Split(utf8resp, "=")
if len(ds) != 2 {
return nil, errors.New("search resp invalid:" + utf8resp)
Expand Down

0 comments on commit c37db2c

Please sign in to comment.