Files
php-curl-class/tests/PHPCurlClass
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-02-17 18:24:42 -05:00