Be polite to API, respect rate limits#1821
Open
unibik wants to merge 3 commits intoaboutcode-org:mainfrom
Open
Be polite to API, respect rate limits#1821unibik wants to merge 3 commits intoaboutcode-org:mainfrom
unibik wants to merge 3 commits intoaboutcode-org:mainfrom
Conversation
Signed-off-by: Arshad <arshad.chotu10@gmail.com>
TG1999
reviewed
Apr 18, 2025
| endpoint = "https://api.github.com/graphql" | ||
| headers = {"Authorization": f"bearer {gh_token}"} | ||
| return requests.post(endpoint, headers=headers, json=graphql_query).json() | ||
| return polite_request(endpoint, headers=headers, json=graphql_query).json() |
Contributor
There was a problem hiding this comment.
Why will this work as a GET request and not a POST request ?
Author
There was a problem hiding this comment.
Thank you @TG1999 for spending your time on my PR and spotting this. You are absolutely right. This should work as a POST request. I should have passed method='POST' .
I'll update _get_gh_response() accordingly to ensure it sends a proper POST request
Contributor
|
@unibik gentle ping on this, what's the progress here ? |
Author
|
Hey @TG1999 , thanks for the reminder! I had paused open-source work for a while after GSoC and continued doing bug bounty programs, but I’d like to pick this up again. I’ll revisit the PR and push the required changes soon.... By the way sorry for late reply, i was busy in my college exams.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: #506
Implemented polite_request to enforce API rate limits and delays