Skip to content

Commit

Permalink
update cache & utils
Browse files Browse the repository at this point in the history
  • Loading branch information
agungdwiprasetyo committed Aug 19, 2022
1 parent 26b58e2 commit ece90f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 4 additions & 3 deletions cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ func (r *RedisCache) Set(ctx context.Context, key string, value interface{}, exp
if _, err = cl.Do("SET", key, value); err != nil {
return
}
if _, err = cl.Do("EXPIRE", key, int(expire.Seconds())); err != nil {
return

if expire >= 0 {
_, err = cl.Do("EXPIRE", key, int(expire.Seconds()))
}
return nil
return
}

// Exists method
Expand Down
3 changes: 0 additions & 3 deletions candiutils/http_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@ func (req *httpRequestImpl) DoRequest(ctx context.Context, method, url string, r
trace.SetTag("http.method", httpReq.Method)
trace.SetTag("http.url", httpReq.URL.String())
trace.SetTag("http.url_path", httpReq.URL.Path)
trace.SetTag("http.min_error_code", req.minHTTPErrorCodeThreshold)
trace.SetTag("http.retries", req.retries)
trace.SetTag("http.sleep_between_retry", req.sleepBetweenRetry.String())
trace.SetTag("http.timeout", req.timeout.String())
trace.SetTag("http.breaker_name", req.breakerName)

Expand Down

0 comments on commit ece90f7

Please sign in to comment.