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 connecting to github because sometimes the connection is refused. #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sclements
Copy link

I added this code because when I tried to migrate issues the script stopped running after github refused a connection. Only a third of the issues were migrated and it wasn't going to be easy to migrate only the remaining issues. This change makes the script retry when github refuses the connection.

@IQAndreas
Copy link
Owner

I'm hesitant to add this feature. There is no delay between requests, so if I'm thinking correctly, the script will continue to send out request after request as many times as it can each second.

I'd rather try to figure out why the request failed. And if there is no way to fix that failed request, perhaps the progress of the script can be stored in a "temporary file" and resumed once GitHub starts accepting requests again.

@IQAndreas
Copy link
Owner

As for the why, how many issues were you importing at once? The GitHub API has a maximum number of requests per day *, so if the script exceeded that amount, that may have been why GitHub refused further requests for a while.

* Each individual issue requires several requests to complete: at least two requests for the issue itself, two for each and every comment on the issue, plus a few extra requests if you are retrieving a list of issues. It adds up quite fast!

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

Successfully merging this pull request may close these issues.

2 participants