Skip to content

Commit

Permalink
improved error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kavehjamshidi authored Aug 18, 2023
1 parent 4d8cc9d commit 036cb3a
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 == redis.Nil {
} else if 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 036cb3a

Please sign in to comment.