mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
feat - add num retries and max retries in exception
This commit is contained in:
parent
0c97694833
commit
2341d99bdc
3 changed files with 24 additions and 5 deletions
|
@ -2041,11 +2041,10 @@ class Router:
|
|||
)
|
||||
await asyncio.sleep(_timeout)
|
||||
|
||||
try:
|
||||
cooldown_deployments = await self._async_get_cooldown_deployments()
|
||||
original_exception.message += f"\nNumber Retries = {current_attempt + 1}, Max Retries={num_retries}\nCooldown Deployments={cooldown_deployments}"
|
||||
except:
|
||||
pass
|
||||
if type(original_exception) in litellm.LITELLM_EXCEPTION_TYPES:
|
||||
original_exception.max_retries = num_retries
|
||||
original_exception.num_retries = current_attempt
|
||||
|
||||
raise original_exception
|
||||
|
||||
def should_retry_this_error(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue