Retry Settings

Retry settings that are applied to tasks in case of failure

class qarnot.retry_settings.RetrySettings(maxTotalRetries: Optional[int] = None, maxPerInstanceRetries: Optional[int] = None)[source]

Bases: object

Represents task retry settings.

__init__(maxTotalRetries: Optional[int] = None, maxPerInstanceRetries: Optional[int] = None)[source]

Create a new RetrySettings.

If neither maxTotalRetries nor maxPerInstanceRetries are set (or if they are equal to 0), the instances will not retry. If both maxTotalRetries and maxPerInstanceRetries are set, then the most restrictive applies.

Parameters
  • maxTotalRetries (int | None) – Maximum total number of retries for the whole task. Default to None.

  • maxPerInstanceRetries (int | None) – Maximum number of retries for each task instance. Default to None.

classmethod from_json(json: Dict[str, int])[source]

Create the retry settings from json.

Parameters

json (dict) – Dictionary representing the retry settings

Returns

The created RetrySettings

to_json() Dict[str, Optional[int]][source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict