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 f66d2e6 commit a2e76adCopy full SHA for a2e76ad
src/openai/_base_client.py
@@ -703,7 +703,7 @@ def _calculate_retry_timeout(
703
# Apply exponential backoff, but not more than the max.
704
sleep_seconds = min(INITIAL_RETRY_DELAY * pow(2.0, nb_retries), MAX_RETRY_DELAY)
705
706
- # Apply some jitter, plus-or-minus half a second.
+ # Apply some jitter, take up to at most 25 percent of the retry time.
707
jitter = 1 - 0.25 * random()
708
timeout = sleep_seconds * jitter
709
return timeout if timeout >= 0 else 0
0 commit comments