Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/agents-api/agents_api/worker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import asyncio
import logging

from tenacity import after_log, retry, retry_if_exception_type, wait_fixed
from tenacity import after_log, retry, retry_if_exception_type, stop_after_attempt, wait_fixed

from ..app import app, lifespan
from ..clients import temporal
Expand All @@ -22,9 +22,12 @@
logger.setLevel(logging.DEBUG)


# AIDEV-NOTE: Allow up to five retries (~100s total) so transient Temporal outages
# can recover while still failing fast enough for orchestration to replace the worker.
@retry(
wait=wait_fixed(20),
retry=retry_if_exception_type(RuntimeError),
stop=stop_after_attempt(5),
after=after_log(logger, logging.DEBUG),
)
async def main() -> None:
Expand Down
Loading