Skip to content

Commit 3f50cc6

Browse files
karesansui-ualdas
authored andcommitted
Fix rate limiter documentation for default burst value
1 parent 675712d commit 3f50cc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

middleware/rate_limiter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ for more info check out Limiter docs - https://pkg.go.dev/golang.org/x/time/rate
169169
170170
Burst and ExpiresIn will be set to default values.
171171
172-
Note that if the provided rate is a float number and Burst is zero, Burst will be treated as the rounded down value of the rate.
172+
Note that if the provided rate is a float number and Burst is zero, Burst will be treated as the rounded up value of the rate.
173173
174174
Example (with 20 requests/sec):
175175
@@ -183,7 +183,7 @@ func NewRateLimiterMemoryStore(rateLimit float64) (store *RateLimiterMemoryStore
183183

184184
/*
185185
NewRateLimiterMemoryStoreWithConfig returns an instance of RateLimiterMemoryStore
186-
with the provided configuration. Rate must be provided. Burst will be set to the rounded down value of
186+
with the provided configuration. Rate must be provided. Burst will be set to the rounded up value of
187187
the configured rate if not provided or set to 0.
188188
189189
The built-in memory store is usually capable for modest loads. For higher loads other

0 commit comments

Comments
 (0)