Skip to content

Commit f4141a2

Browse files
committed
docs(client): update comment on timeout calculation per review feedback.
1 parent 521bb4a commit f4141a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/openai/_base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ def _calculate_retry_timeout(
704704
# Apply exponential backoff, but not more than the max.
705705
sleep_seconds = min(INITIAL_RETRY_DELAY * pow(2.0, nb_retries), MAX_RETRY_DELAY)
706706

707-
# Apply some jitter, take up to at most 25 percent of the retry time.
707+
# Reduce the calculated timeout by a random range between 0-25%
708708
jitter = 1 - 0.25 * random()
709709
timeout = sleep_seconds * jitter
710710
return timeout if timeout >= 0 else 0

0 commit comments

Comments
 (0)