github: fix rate limiting

It seems like the error message that github return changed.
This commit is contained in:
Michael Muré 2022-11-15 19:24:16 +01:00
parent 53059ecbfe
commit a52c474f11
No known key found for this signature in database
GPG Key ID: A4457C029293126F

View File

@ -130,7 +130,8 @@ func (c *rateLimitHandlerClient) callAPIDealWithLimit(ctx context.Context, apiCa
return nil
}
// matching the error string
if strings.Contains(err.Error(), "API rate limit exceeded") {
if strings.Contains(err.Error(), "API rate limit exceeded") ||
strings.Contains(err.Error(), "was submitted too quickly") {
// a rate limit error
qctx, cancel = context.WithTimeout(ctx, defaultTimeout)
defer cancel()