Skip to content

Commit

Permalink
Fix float state issue (#2)
Browse files Browse the repository at this point in the history
usleep requires int argument, retry_after can somehow return as float, which can cause exceptions to be thrown.
  • Loading branch information
QartemisT authored Jan 27, 2023
1 parent fbbab46 commit 075abb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Webhook/DiscordWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private function runCurl(string $url, string $method, ?AbstractDiscordMessage $p

if (429 === $code) {
$response = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
usleep($response['retry_after'] * 1000);
usleep((int) ($response['retry_after'] * 1000));
} else {
$sent = true;
if ($code < 200 || $code >= 400) {
Expand Down

0 comments on commit 075abb9

Please sign in to comment.