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

Feature Request: A doRetry parameter #299

Open
apaparazzi0329 opened this issue Sep 20, 2021 · 7 comments
Open

Feature Request: A doRetry parameter #299

apaparazzi0329 opened this issue Sep 20, 2021 · 7 comments
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request
Projects

Comments

@apaparazzi0329
Copy link

I was recently implementing a feature in my application that would grab repository statistics from the GET /repos/{owner}/{repo}/contributors endpoint. The problem I ran into was that if statistics have not been compiled before then the endpoint will return a 202 and you will have to retry and poll again to see if the results are ready. It would be nice if this plugin had a "doRetry" parameter that would allow retries for requests that return specified status codes as opposed to only status codes above 400. As it stands, my current implementation is unable to use this plugin and uses a timed loop until a 200 is received. I believe this will be a very useful feature as other endpoints that return a 202 and require retries will be easier to implement.

@ghost ghost added this to Inbox in JS Sep 20, 2021
@apaparazzi0329
Copy link
Author

Let me know if the team is interested in this feature, I would be willing to create a PR for this feature

@gr2m
Copy link
Contributor

gr2m commented Sep 22, 2021

did you try setting retry on the specific request? We have this documented in our docs

image

@ghost ghost moved this from Inbox to Awaiting response in JS Sep 22, 2021
@apaparazzi0329
Copy link
Author

"requests will be retried no matter their response code"? So does that mean even if I get a 200 response that the plugin will continue to retry up until the max retries?

@gr2m
Copy link
Contributor

gr2m commented Oct 7, 2021

So does that mean even if I get a 200 response that the plugin will continue to retry up until the max retries?

no, only in case of error responses (>=400)

@apaparazzi0329
Copy link
Author

So there is currently no way to retry on a 202 response using this plugin?

@gr2m
Copy link
Contributor

gr2m commented Oct 7, 2021

I don't think so, not at this point. Now I understand your request for the doRetry parameter, sorry it took me so long.

Yes, I agree, a doRetry parameter might be helpful, in some cases we have to do retries only in case of a 404 to account for replication lags of installation access tokens, I think I implemented this functionality manually for that case.

I'd accept a pull request if you are interested in implementing it. However it would need to be done fast, Sunday will be my last day working on Octokit for the foreseeable future, and I don't think anyone else will look at issues / PRs.

@apaparazzi0329
Copy link
Author

Unfortunately, I do not have the time for this on such a short time frame. Good luck on your future endeavors :)

@gr2m gr2m added feature and removed support labels Oct 8, 2021
@ghost ghost moved this from Awaiting response to Features in JS Oct 8, 2021
@ghost ghost moved this from Features to Inbox in JS Oct 31, 2022
@wolfy1339 wolfy1339 added the Type: Feature New feature or request label Dec 16, 2022
@ghost ghost moved this from Inbox to Features in JS Dec 16, 2022
@wolfy1339 wolfy1339 added the Status: Up for grabs Issues that are ready to be worked on by anyone label Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request
Projects
No open projects
JS
  
Features
Development

No branches or pull requests

4 participants