Skip to content

Commit 4237d35

Browse files
committed
Removing useless duration from get
1 parent 5480d40 commit 4237d35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (l *Limiter) Verify(name string, maxn int64, dur time.Duration) (count, res
102102
allow = l.fallbackLimiter.Allow()
103103

104104
name = fmt.Sprintf("%s:%s-%d", redisPrefix, name, slot)
105-
count, err := l.get(name, dur)
105+
count, err := l.get(name)
106106
if err == nil {
107107
allow = count <= maxn
108108
}
@@ -132,7 +132,7 @@ func (l *Limiter) incr(name string, dur time.Duration) (int64, error) {
132132
return rate, err
133133
}
134134

135-
func (l *Limiter) get(name string, dur time.Duration) (int64, error) {
135+
func (l *Limiter) get(name string) (int64, error) {
136136
var getCmd *redis.StringCmd
137137
_, err := l.redis.Pipelined(func(pipe *redis.Pipeline) error {
138138
getCmd = pipe.Get(name)

0 commit comments

Comments
 (0)