Skip to content

Commit

Permalink
Explicitly cast wait duration to int using ceil to prevent depreciati…
Browse files Browse the repository at this point in the history
…on warning
  • Loading branch information
David Wakelin committed Feb 28, 2022
1 parent d245cf1 commit defa1f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "macroman/rate-limiter",
"description": "General framework agnostic rate limiter",
"version": "1.0.2",
"version": "1.0.3",
"type": "library",
"homepage": "https://github.com/MacroMan/rate-limiter",
"license": "GPL-3.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion src/RateLimiter/Limiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function await(): void

if (!$this->is_free()) {
$wait_duration = $this->duration_until_free();
usleep($wait_duration);
usleep(ceil($wait_duration));
}
}

Expand Down

0 comments on commit defa1f1

Please sign in to comment.