diff options
author | Vladimir Shushlin <v.shushlin@gmail.com> | 2021-12-09 17:17:17 +0300 |
---|---|---|
committer | Vladimir Shushlin <v.shushlin@gmail.com> | 2021-12-20 14:10:35 +0300 |
commit | 91dd7bc9011640dd02b497acf9fa78bee35a8402 (patch) | |
tree | a42e4d7ca3b2d169fc8454952ff90e2075589481 /app.go | |
parent | f8512edbec4ec83b426c8ca2dda467de424685e4 (diff) |
refactor: handle defaults in ratelimiter package itself
also fix tests:
* float64(1/time.Milesecond) == 0
* rate package doesn't actually refill the bucket on
fractional seconds, so we need to use integers
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -258,7 +258,7 @@ func (a *theApp) buildHandlerPipeline() (http.Handler, error) { handler = routing.NewMiddleware(handler, a.source) - handler = handlers.Ratelimiter(handler, a.config) + handler = handlers.Ratelimiter(handler, &a.config.RateLimit) // Health Check handler, err = a.healthCheckMiddleware(handler) |