CSCGLOBAL: Be silent about backoffs less than 10s (#2588)

This commit is contained in:
Tom Limoncelli 2023-10-08 11:33:42 -04:00 committed by GitHub
parent 46f15114dd
commit e7f1872fd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {