-
-
Notifications
You must be signed in to change notification settings - Fork 30
Description
From time to time requests fail with a 502 Bad Gateway as even the GitHub API has downtimes. Similar to #140 we should catch this exception and do a proper retry of the job. But in that case we can use the third argument of the retry() method in the Client builder as we want to just retry the exact same request if we get a 502. laravel/framework#38531
The when Closure should use a full closure - likely static (https://twitter.com/devgummibeer/status/1425452816043286536) - to allow more complex checks in the future and add more status codes to retry without having a too large diff. In best case it should also use the Closure option for the delay to increase the delay with every try. Starting with 500ms and ending with 30s or something over 3-5 retries.
This logic should be added in the Http::github() macro to have the same logic for all GitHub API requests.