no bursts to avoid 429 and 30 sec waits

This commit is contained in:
Miloš Jovanović 2026-09-24 20:48:36 -07:00
parent 18e8cb055e
commit 0fe54519ea

View file

@ -29,8 +29,8 @@ func NewClient(key string, dryRun bool) *Client {
key: key, key: key,
dryRun: dryRun, dryRun: dryRun,
http: &http.Client{Timeout: 30 * time.Second}, http: &http.Client{Timeout: 30 * time.Second},
// 60 requests per 30 seconds: 2/sec sustained, burst of 60. // limit to 2 requests per second, no bursts to avoid 429s
limiter: rate.NewLimiter(2, 60), limiter: rate.NewLimiter(2, 1),
} }
} }