Skip to content

Commit

Permalink
Minor logging tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc45 committed Mar 7, 2024
1 parent 787466e commit b72b767
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/src/RequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,10 @@ public function request(): string {
if ( $response_status_code === 429 ) {
if ( $this->retry_429 > 0 ) {
$this->retry_429 --;
App::make( Output::class )->writeln( '<comment>Request failed... Retrying (429 Too many Requests)</comment>' );
$sleep_seconds = $this->wait_after_429( $headers );
App::make( Output::class )->writeln( sprintf( '<comment>Request failed... Waiting %d seconds and retrying (429 Too many Requests)</comment>', $sleep_seconds ) );

sleep( $this->wait_after_429( $headers ) );
sleep( $sleep_seconds );
goto retry_request; // phpcs:ignore Generic.PHP.DiscourageGoto.Found
}
} else {
Expand Down

0 comments on commit b72b767

Please sign in to comment.