This repository was archived by the owner on Dec 10, 2024. It is now read-only.
Commit a449e2b
committed
Place a floor of 1 on the rate limit burst to prevent x/time from throwing an error.
If GitLab is enforcing rate limits of fewer than 3 per second the
existing logic will set burst to zero (it multiples the per-second
value by 0.33 and then casts to int).
rate.Limiter.Wait will fail if burst is zero with the message here:
https://github.com/golang/time/blob/b24d3b5e50f7b0e18486d18f0a240d04d254ea73/rate/rate.go#L257
As Wait falls back to WaitN with n=1:
https://github.com/golang/time/blob/b24d3b5e50f7b0e18486d18f0a240d04d254ea73/rate/rate.go#L2311 parent 793bc3c commit a449e2b
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
536 | 541 | | |
537 | 542 | | |
538 | 543 | | |
| |||
0 commit comments