GNU bug report logs -
#54241
[PATCH 0/4] 'github' importer gracefully handles rate limiting
Previous Next
Reported by: Ludovic Courtès <ludo <at> gnu.org>
Date: Thu, 3 Mar 2022 21:14:01 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #32 received at 54241 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Ludovic Courtès schreef op do 03-03-2022 om 22:14 [+0100]:
> + (and (not (request-rate-limit-reached?))
> + (guard (c ([...]
> + ;; See
> + ;; <https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting>.
> + (match (assq-ref (http-get-error-headers c)
> + 'x-ratelimit-remaining)
> + (#f
> + (raise c))
> + ((? (compose zero? string->number))
> + (let ((reset (update-rate-limit-reset-time!
> + (http-get-error-headers c))))
> + (warning (G_ "GitHub rate limit exceeded; \
> +disallowing requests for ~a seconds~%")
> + (- reset (car (gettimeofday))))
> + (display-hint (G_ "You can waive the rate limit by
> +setting the @env{GUIX_GITHUB_TOKEN} environment variable to a token obtained
> +from @url{https://github.com/settings/tokens} with your GitHub account.
IIRC, the GitHub documentation doesn't state that this waives the rate
limit, rather it increases the rate limit a lot, but there's still a
limit.
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 78 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.