MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / calculate_delay

Method calculate_delay

mini_agent/retry.py:51–61  ·  view source on GitHub ↗

Calculate delay time (exponential backoff) Args: attempt: Current attempt number (starting from 0) Returns: Delay time (seconds)

(self, attempt: int)

Source from the content-addressed store, hash-verified

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
64class RetryExhaustedError(Exception):

Callers 2

on_retryFunction · 0.80
wrapperFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected