Skip to content

Commit

Permalink
Makes sure throttle value is integer
Browse files Browse the repository at this point in the history
  • Loading branch information
Arul- committed Aug 14, 2021
1 parent 906bdcc commit 1c2fa5b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Restler.php
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,7 @@ protected function respond()
//handle throttling
if (Defaults::$throttle) {
$elapsed = time() - $this->startTime;
Defaults::$throttle = intval(Defaults::$throttle);
if (Defaults::$throttle / 1e3 > $elapsed) {
usleep(1e6 * (Defaults::$throttle / 1e3 - $elapsed));
}
Expand Down

0 comments on commit 1c2fa5b

Please sign in to comment.