You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-07-05 00:59:04 +02:00
fix(github): check rate limit again after sleeping (#4152)
also ensure sleep > 0 --------- Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e9760a167b
commit
f883131e73
@ -75,8 +75,15 @@ func (c *githubClient) checkRateLimit(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
sleep := limits.Core.Reset.UTC().Sub(time.Now().UTC())
|
||||
if sleep <= 0 {
|
||||
// it seems that sometimes, after the rate limit just reset, it might
|
||||
// still get <100 remaining and a reset time in the past... in such
|
||||
// cases we can probably sleep a bit more before trying again...
|
||||
sleep = 15 * time.Second
|
||||
}
|
||||
log.Warnf("token too close to rate limiting, will sleep for %s before continuing...", sleep)
|
||||
time.Sleep(sleep)
|
||||
c.checkRateLimit(ctx)
|
||||
}
|
||||
|
||||
func (c *githubClient) GenerateReleaseNotes(ctx *context.Context, repo Repo, prev, current string) (string, error) {
|
||||
|
Reference in New Issue
Block a user