Skip to content

Commit

Permalink
Uses set instead of setnx to avoid invalidated data to keep
Browse files Browse the repository at this point in the history
  • Loading branch information
Masood Adeli committed Sep 22, 2020
1 parent e5a580e commit 9abfc92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c-redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (rc *redisCache) Set(ctx context.Context, key string, value interface{}) er
}
client := rc.pickClient(key, true).WithContext(ctx)
startMarker := rc.watcher.Start()
setError := client.SetNX(key, finalData, rc.cacheTTL).Err()
setError := client.Set(key, finalData, rc.cacheTTL).Err()
if setError != nil {
rc.watcher.Done(startMarker, rc.layerName, "set", "error")
} else {
Expand Down

0 comments on commit 9abfc92

Please sign in to comment.