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 a8854b5 commit 8fd6a5dCopy full SHA for 8fd6a5d
workos/utils/_base_http_client.py
@@ -237,13 +237,13 @@ def _calculate_backoff_delay(
237
The delay in seconds to wait before the next retry
238
"""
239
# Exponential backoff: base_delay * 2^attempt
240
- delay = retry_config.base_delay * (2**attempt)
+ delay: float = retry_config.base_delay * (2**attempt)
241
242
# Cap at max_delay
243
delay = min(delay, retry_config.max_delay)
244
245
# Add jitter: random variation of 0-25% of delay
246
- jitter_amount = delay * retry_config.jitter * random.random()
+ jitter_amount: float = delay * retry_config.jitter * random.random()
247
return delay + jitter_amount
248
249
def _should_retry_exception(self, exc: Exception) -> bool:
0 commit comments