feat: change to enable token pool#125
Open
ota-meshi wants to merge 2 commits into
Open
Conversation
pi0
reviewed
May 24, 2025
| export default defineNitroConfig({ | ||
| runtimeConfig: { | ||
| GH_TOKEN: process.env.GH_TOKEN, | ||
| GH_TOKEN2: process.env.GH_TOKEN2, |
Member
There was a problem hiding this comment.
We need to support an array (not just 2 hardcoded) also we need to read it from a json source (in code or later remote URL)
Author
There was a problem hiding this comment.
I wasn't sure what the best way to define an array for an environment variable was.
Would it be better to define an array in JSON for an environment variable like GH_TOKENS?
Also, if we define GH_TOKENS, can I remove GH_TOKEN?
Author
There was a problem hiding this comment.
later remote URL
This looks really cool, but I'm not sure how to implement it 😅
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.
related to #5
This PR will improve the server to make the token pool available.
About the implementation:
Currently the implementation makes the second token available through the GH_TOKEN2 environment variable, but that can be changed. Please let me know your preferred way of defining it.-> The way tokens are defined has been changed so that
GH_TOKENSis specified as an array in JSON.The priority for using tokens is the token with the most remaining rate limit window. However, since the number of remaining rate limits is not known until each token is used to make a request, they are used in order regardless of the rate limit window.
Additional comments:
We are still discussing how to collect the token pool in #5, so I don't think this PR change alone will enable the token pool, but I would be happy if I could contribute the first step.