Skip to content

Commit

Permalink
use exported error redis.Nil
Browse files Browse the repository at this point in the history
  • Loading branch information
kavehjamshidi authored Aug 10, 2023
1 parent 92da146 commit 4d8cc9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion slidingwindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (s *SlidingWindowRedis) Increment(ctx context.Context, prev, curr time.Time
case <-done:
if err == redis.TxFailedErr {
return 0, 0, errors.Wrap(err, "redis transaction failed")
} else if err != nil && err.Error() == "redis: nil" { // TODO: is there an exported error of that type?
} else if err != nil && err == redis.Nil {
prevCount = 0
} else if err != nil {
return 0, 0, errors.Wrap(err, "unexpected error from redis")
Expand Down

0 comments on commit 4d8cc9d

Please sign in to comment.