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

Fix/GitHub retry on abuse #12

Merged
merged 6 commits into from
Jul 13, 2021
Merged

Fix/GitHub retry on abuse #12

merged 6 commits into from
Jul 13, 2021

Conversation

geoheelias
Copy link
Contributor

No description provided.

@geoheelias geoheelias requested a review from puhoy July 13, 2021 20:29
@geoheelias geoheelias self-assigned this Jul 13, 2021
return self.requests.post(
url=self.request_url,
json=dict(query=self.query, variables=variables)
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're repeating this request, so it gets a function

logger.warning(f"status 403 sleeping for {GITHUB_API_ABUSE_SLEEP}"
f"- probably triggered abuse flag? json:\n{response.json()}")
time.sleep(GITHUB_API_ABUSE_SLEEP)
response = send_query()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log sleep and retry until upper limit has been reached, at which point we will get a skipped block chunk and have a hole in our data.

@puhoy puhoy merged commit ee5ca10 into master Jul 13, 2021
@puhoy puhoy deleted the fix/github_retry_on_abuse branch July 13, 2021 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants