Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry GitHub API 502 Bad Gateway requests #141

Open
Gummibeer opened this issue Aug 26, 2021 · 0 comments
Open

Retry GitHub API 502 Bad Gateway requests #141

Gummibeer opened this issue Aug 26, 2021 · 0 comments

Comments

@Gummibeer
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant