refactor: Centralize retry timeout and use consistent value

This commit is contained in:
Paul Gauthier 2024-10-15 12:25:05 -07:00 committed by Paul Gauthier (aider)
parent 26058c89fe
commit 6bb9b2567f
2 changed files with 5 additions and 3 deletions

View file

@ -27,7 +27,7 @@ from aider.llm import litellm
from aider.repo import ANY_GIT_ERROR, GitRepo
from aider.repomap import RepoMap
from aider.run_cmd import run_cmd
from aider.sendchat import retry_exceptions, send_completion
from aider.sendchat import RETRY_TIMEOUT, retry_exceptions, send_completion
from aider.utils import format_content, format_messages, format_tokens, is_image_file
from ..dump import dump # noqa: F401
@ -1131,7 +1131,7 @@ class Coder:
except retry_exceptions() as err:
self.io.tool_warning(str(err))
retry_delay *= 2
if retry_delay > 60:
if retry_delay > RETRY_TIMEOUT:
break
self.io.tool_output(f"Retrying in {retry_delay:.1f} seconds...")
time.sleep(retry_delay)