We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b9e3a8 commit ef7cafdCopy full SHA for ef7cafd
management/server/http/middleware/rate_limiter.go
@@ -1,6 +1,7 @@
1
package middleware
2
3
import (
4
+ "context"
5
"sync"
6
"time"
7
@@ -68,9 +69,9 @@ func (rl *APIRateLimiter) Allow(key string) bool {
68
69
70
// Wait blocks until the rate limiter allows another request for the given key
71
// Returns an error if the context is canceled
-func (rl *APIRateLimiter) Wait(key string) error {
72
+func (rl *APIRateLimiter) Wait(ctx context.Context, key string) error {
73
limiter := rl.getLimiter(key)
- return limiter.Wait(nil)
74
+ return limiter.Wait(ctx)
75
}
76
77
// getLimiter retrieves or creates a rate limiter for the given key
0 commit comments