diff --git a/slidingwindow.go b/slidingwindow.go index ff2d813..7323ce0 100644 --- a/slidingwindow.go +++ b/slidingwindow.go @@ -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")