From 4e8fb894ef66528b4a9d53a877d25ed341ac55ba Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Tue, 5 Dec 2023 10:02:55 -0500 Subject: [PATCH] CSCGLOBAL: Be less noisy about rate limit delays (#2686) --- providers/cscglobal/api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/providers/cscglobal/api.go b/providers/cscglobal/api.go index 6ae57f5c6..161acccc4 100644 --- a/providers/cscglobal/api.go +++ b/providers/cscglobal/api.go @@ -647,7 +647,7 @@ func (client *providerClient) geturl(url string) ([]byte, error) { // Default CSCGlobal rate limit is twenty requests per second var backoff = time.Second - const maxBackoff = time.Second * 15 + const maxBackoff = time.Second * 25 retry: resp, err := hclient.Do(req) @@ -666,9 +666,9 @@ retry: if string(bodyString) == "Requests exceeded API Rate limit." { // a simple exponential back-off with a 3-minute max. - if backoff > 10 { + if backoff > (time.Second * 10) { // With this provider backups seem to be pretty common. Only - // announce it when the problem gets really bad. + // announce it for long delays. printer.Printf("Delaying %v due to ratelimit (CSCGLOBAL)\n", backoff) } time.Sleep(backoff)