Skip to content

Commit

Permalink
Avoid setting a negative request rate.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisberkhout committed Jul 22, 2024
1 parent f3f772f commit a06612b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func oktaRateLimit(h http.Header, window time.Duration, limiter *rate.Limiter) e
rateLimit := rate.Limit(rem / per)

// Process reset if we need to wait until reset to avoid a request against a zero quota.
if rateLimit == 0 {
if rateLimit <= 0 {
waitUntil := resetTime.UTC()
// next gives us a sane next window estimate, but the
// estimate will be overwritten when we make the next
Expand Down

0 comments on commit a06612b

Please sign in to comment.