Enhance documentation across multiple modules with detailed parameter descriptions and usage examples
27 lines
802 B
Python
27 lines
802 B
Python
"""
|
|
|
|
Laborious Temporal Workflows Retry Policies
|
|
|
|
This module defines retry policies for Temporal workflows in the Laborious system.
|
|
These policies ensure reliable execution of ML prediction workflows by automatically
|
|
retrying failed operations with exponential backoff.
|
|
|
|
The retry_policy variable configures:
|
|
- Initial retry interval of 1 second
|
|
- Exponential backoff coefficient of 2.0
|
|
- Maximum retry interval capped at 1 minute
|
|
- Maximum of 1 retry attempt
|
|
|
|
This configuration helps prevent cascading failures while maintaining system responsiveness.
|
|
|
|
"""
|
|
from datetime import timedelta
|
|
from temporalio.common import RetryPolicy
|
|
|
|
retry_policy = RetryPolicy(
|
|
initial_interval=timedelta(seconds=1),
|
|
backoff_coefficient=2.0,
|
|
maximum_interval=timedelta(minutes=1),
|
|
maximum_attempts=1
|
|
)
|