Refactor get_github_auth_token #71
Merged
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.
I realized that it's possible to use multiple auth tokens for GitHub, which is a life-saver. Thanks for that ✌
Now generate script takes much less time to run.
While I was using multiple tokens, I noticed that
get_github_auth_token
function doesn't take the shortest wait time but just uses the wait time of the last token. Although not sure how much this would improve the process but I wanted to try refactoring it.Here is the summary of this update:
_CACHED_GITHUB_TOKENS
global variable that storestoken
,token_obj
andreset
data as a listget_github_auth_token
returns an object from this listOne more small update that I could do is to eliminate the use of
_CACHED_GITHUB_TOKEN
global variable, which is used inget_first_commit_time
function. But that would mean one more "rate limit" check. If you think that's okay, I could update that part as well?I keep sending these PRs to able to sync with my fork but since we don't have prior discussions about these updates, if it doesn't align with your work, feel free to ignore them as usual 🙏