mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix(router.py): fix router should_retry
This commit is contained in:
parent
71d63c33da
commit
c70fbd0654
2 changed files with 38 additions and 20 deletions
|
@ -1625,12 +1625,10 @@ class Router:
|
|||
min_timeout=self.retry_after,
|
||||
)
|
||||
time.sleep(timeout)
|
||||
elif (
|
||||
hasattr(e, "status_code")
|
||||
and hasattr(e, "response")
|
||||
and litellm._should_retry(status_code=e.status_code)
|
||||
elif hasattr(e, "status_code") and litellm._should_retry(
|
||||
status_code=e.status_code
|
||||
):
|
||||
if hasattr(e.response, "headers"):
|
||||
if hasattr(e, "response") and hasattr(e.response, "headers"):
|
||||
timeout = litellm._calculate_retry_after(
|
||||
remaining_retries=remaining_retries,
|
||||
max_retries=num_retries,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue