mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-30 14:35:17 +02:00
retry use wait_random_exponential
This commit is contained in:
parent
4127ef8570
commit
70cbfb1e48
1 changed files with 2 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ from tenacity import (
|
|||
retry,
|
||||
retry_if_exception_type,
|
||||
stop_after_attempt,
|
||||
wait_fixed,
|
||||
wait_random_exponential,
|
||||
)
|
||||
import google.generativeai as genai
|
||||
from google.ai import generativelanguage as glm
|
||||
|
|
@ -139,7 +139,7 @@ class GeminiGPTAPI(BaseGPTAPI):
|
|||
|
||||
@retry(
|
||||
stop=stop_after_attempt(3),
|
||||
wait=wait_fixed(1),
|
||||
wait=wait_random_exponential(min=1, max=60),
|
||||
after=after_log(logger, logger.level("WARNING").name),
|
||||
retry=retry_if_exception_type(ConnectionError),
|
||||
retry_error_callback=log_and_reraise
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue