mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
added ServiceUnavailableError for retries
This commit is contained in:
parent
1acc5e04d0
commit
8dcf819cb5
1 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ import backoff
|
|||
import git
|
||||
import openai
|
||||
import requests
|
||||
from openai.error import RateLimitError
|
||||
from openai.error import RateLimitError, ServiceUnavailableError
|
||||
from rich.console import Console
|
||||
from rich.live import Live
|
||||
from rich.markdown import Markdown
|
||||
|
@ -494,7 +494,7 @@ class Coder:
|
|||
|
||||
@backoff.on_exception(
|
||||
backoff.expo,
|
||||
(RateLimitError, requests.exceptions.ConnectionError),
|
||||
(ServiceUnavailableError, RateLimitError, requests.exceptions.ConnectionError),
|
||||
max_tries=5,
|
||||
on_backoff=lambda details: print(f"Retry in {details['wait']} seconds."),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue