From feb2d1a7378ddb5c4416a608030b2a81a4cef86d Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Thu, 15 Dec 2022 18:25:57 +0100 Subject: [PATCH] Fix rate limiter window duration (#424) Gubernator's duration parameter should be in miliseconds, according to their own documentation: https://github.com/mailgun/gubernator/blob/v1.0.1-rc.1/README.md?plain=1#L41. --- ratelimit/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ratelimit/http.go b/ratelimit/http.go index aee3f57e4..7e63c86b8 100644 --- a/ratelimit/http.go +++ b/ratelimit/http.go @@ -65,7 +65,7 @@ func WithSharedRateLimiter(logger log.Logger, client SharedRateLimiter, configs name: requestName, key: fmt.Sprintf("%s:%s", c.Tenant, c.Matcher.String()), limit: int64(c.Limit), - duration: c.Window.Microseconds(), + duration: c.Window.Milliseconds(), }}.Handler}) }