Calculate delay time (exponential backoff) Args: attempt: Current attempt number (starting from 0) Returns: Delay time (seconds)
(self, attempt: int)
| 49 | self.retryable_exceptions = retryable_exceptions |
| 50 | |
| 51 | def calculate_delay(self, attempt: int) -> float: |
| 52 | """Calculate delay time (exponential backoff) |
| 53 | |
| 54 | Args: |
| 55 | attempt: Current attempt number (starting from 0) |
| 56 | |
| 57 | Returns: |
| 58 | Delay time (seconds) |
| 59 | """ |
| 60 | delay = self.initial_delay * (self.exponential_base**attempt) |
| 61 | return min(delay, self.max_delay) |
| 62 | |
| 63 | |
| 64 | class RetryExhaustedError(Exception): |