Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions internal/requestconfig/requestconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ func NewRequestConfig(ctx context.Context, method string, u string, body interfa
req.Header.Add(k, v)
}
cfg := RequestConfig{
MaxRetries: 2,
// Increased from 2 to 10 for better rate limit handling
MaxRetries: 10,
Context: ctx,
Request: req,
HTTPClient: http.DefaultClient,
Expand Down Expand Up @@ -369,8 +370,11 @@ func retryDelay(res *http.Response, retryCount int) time.Duration {
return retryAfterDelay
}

maxDelay := 8 * time.Second
delay := time.Duration(0.5 * float64(time.Second) * math.Pow(2, float64(retryCount)))
// Increased for better rate limit handling:
// - maxDelay increased from 8s to 30s to match common rate limit windows
// - base multiplier increased from 0.5 to 2.0 for longer waits
maxDelay := 30 * time.Second
delay := time.Duration(2.0 * float64(time.Second) * math.Pow(2, float64(retryCount)))
if delay > maxDelay {
delay = maxDelay
}
Expand Down
Loading