Open bnb opened 5 years ago
Maybe this can be useful https://octokit.github.io/rest.js/#throttling
@bnb would this be done inside the libgfi project?
Theoretically, yes. Practically, I'm not certain.
Emitting a warning and preventing the process from crashing in libgfi
would be ideal, instead returning an error object. Then, catching and pretty printing that there was an error from good-first-issue
is the part that we'd want to implement here.
We'd also likely want to support consuming an environment variable that contains a GitHub token so developers can get around default rate limits. May also be worth having a second environment variable to turn that on/off.
@bnb Please check my pull request I updated libgfi to handle rateLimit and abuseLimit, it now logs one simple line to the user and exits gracefully. I updated the examples and README to reflect this. Let me know if this doesn't satisfy the requirements.
Currently, if a user runs too many searches they hit a rate limit. It would be awesome if we could pretty print a message about this rather than logging the JSON :)