-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
578f473
commit a1fb6aa
Showing
1 changed file
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
from datetime import timedelta | ||
|
||
from temporalio.common import RetryPolicy | ||
|
||
from ..env import debug, testing | ||
DEFAULT_RETRY_POLICY = RetryPolicy( | ||
initial_interval=timedelta(seconds=1), | ||
backoff_coefficient=2, | ||
maximum_attempts=2, | ||
maximum_interval=timedelta(seconds=10), | ||
maximum_attempts=2 if debug or testing else 25, | ||
maximum_interval=timedelta(seconds=10) if debug or testing else timedelta(seconds=300), | ||
non_retryable_error_types=[ | ||
"WorkflowExecutionAlreadyStarted", | ||
"TypeError", | ||
"AssertionError", | ||
"HTTPException", | ||
"SyntaxError", | ||
"ValueError", | ||
"ZeroDivisionError", | ||
"jinja2.exceptions.TemplateSyntaxError", | ||
"jinja2.exceptions.TemplateNotFound", | ||
"jsonschema.exceptions.ValidationError", | ||
"pydantic.ValidationError", | ||
"asyncio.CancelledError", | ||
"asyncio.InvalidStateError", | ||
"requests.exceptions.InvalidURL", | ||
"requests.exceptions.MissingSchema", | ||
"temporalio.exceptions.TerminalFailure", | ||
"temporalio.exceptions.CanceledError", | ||
"fastapi.exceptions.HTTPException", | ||
"fastapi.exceptions.RequestValidationError", | ||
"httpx.RequestError", | ||
"httpx.HTTPStatusError", | ||
], | ||
) |