From e7f1872fd5f90f019268a153265f079446b73e65 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Sun, 8 Oct 2023 11:33:42 -0400 Subject: [PATCH] CSCGLOBAL: Be silent about backoffs less than 10s (#2588) --- providers/cscglobal/api.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/providers/cscglobal/api.go b/providers/cscglobal/api.go index df141d753..dd8224013 100644 --- a/providers/cscglobal/api.go +++ b/providers/cscglobal/api.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "log" "net/http" "os" "sort" @@ -665,7 +664,11 @@ retry: if string(bodyString) == "Requests exceeded API Rate limit." { // a simple exponential back-off with a 3-minute max. - log.Printf("Delaying %v due to ratelimit\n", backoff) + if backoff > 10 { + // With this provider backups seem to be pretty common. Only + // announce it when the problem gets really bad. + printer.Printf("Delaying %v due to ratelimit (CSCGLOBAL)\n", backoff) + } time.Sleep(backoff) backoff = backoff + (backoff / 2) if backoff > maxBackoff {