Skip to content

Commit 11df24d

Browse files
authored
close the token channel (#24)
1 parent aa416f1 commit 11df24d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ratelimit.go

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func (ratelimiter *Limiter) SleepandReset(sleepTime time.Duration, newLimit uint
7070

7171
// Stop the rate limiter canceling the internal context
7272
func (ratelimiter *Limiter) Stop() {
73+
defer close(ratelimiter.tokens)
7374
if ratelimiter.cancelFunc != nil {
7475
ratelimiter.cancelFunc()
7576
}

0 commit comments

Comments
 (0)