Skip to content

Commit 1025938

Browse files
cursoragentntindle
andcommitted
Refactor: Improve replicate retry logic and remove unused import
Co-authored-by: nicholas.tindle <[email protected]>
1 parent 0ad0776 commit 1025938

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

autogpt_platform/backend/backend/blocks/ai_music_generator.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import asyncio
21
import logging
32
from enum import Enum
43
from typing import Literal
54

65
from pydantic import SecretStr
76
from replicate.client import Client as ReplicateClient
8-
97
from replicate.helpers import FileOutput
108

119
from backend.blocks.replicate._helper import run_replicate_with_retry

autogpt_platform/backend/backend/blocks/replicate/_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async def run_replicate_with_retry(
8585
except Exception as e:
8686
last_error = e
8787
if attempt < max_retries - 1:
88-
wait_time = retry_delay * (2 ** attempt)
88+
wait_time = retry_delay * (2**attempt)
8989
logger.warning(
9090
f"Replicate attempt {attempt + 1} failed: {str(e)}. Retrying in {wait_time}s..."
9191
)

0 commit comments

Comments
 (0)