We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 521bb4a commit f4141a2Copy full SHA for f4141a2
src/openai/_base_client.py
@@ -704,7 +704,7 @@ def _calculate_retry_timeout(
704
# Apply exponential backoff, but not more than the max.
705
sleep_seconds = min(INITIAL_RETRY_DELAY * pow(2.0, nb_retries), MAX_RETRY_DELAY)
706
707
- # Apply some jitter, take up to at most 25 percent of the retry time.
+ # Reduce the calculated timeout by a random range between 0-25%
708
jitter = 1 - 0.25 * random()
709
timeout = sleep_seconds * jitter
710
return timeout if timeout >= 0 else 0
0 commit comments