Files
php-curl-class/tests
Zach Borboa 4bf7292438 Fix rate limit (#1015)
* Rate limit fix

If $elapsed_seconds > $this->intervalSeconds the first time hasRequestQuota() is called, rateLimitReached is never set to true and the limit is not enforced
This can happen if the rate limit is set in a callback function some time after starting

I completely removed $rateLimitReached since its only use was in the removed condition check

Alternatively, it should be possible to reinitialize currentStartTime when setRateLimit is called, but I still don't really see the usefulness of resetting the timer only when the limit was reached in the previous interval

* Rename variable

* Clean up

---------

Co-authored-by: Riccardo Nava <116394015+ricnava00@users.noreply.github.com>
2025-11-15 17:08:55 -05:00
..
2025-11-15 17:08:55 -05:00
2023-10-21 19:19:57 -07:00
2023-10-21 19:19:57 -07:00
2025-03-08 10:45:51 -05:00
2025-03-08 13:44:18 -05:00