Saltar a contenido

Reintentos

Política de reintentos aplicada por AlegraClient. Ver también la guía de reintentos automáticos.

alegrapy.retry.RetryPolicy dataclass

How many times and how long to wait before retrying a failed request.

Attributes:

Name Type Description
max_retries int

Extra attempts after the first one; 0 disables retries.

backoff_factor float

Base delay in seconds for exponential backoff.

backoff_max float

Upper bound for a computed backoff delay, in seconds.

retry_statuses frozenset[int]

HTTP statuses retried for idempotent methods. 500 is not included by default because on Alegra it usually means the payload was rejected.

max_retry_after float

Longest Retry-After / X-Rate-Limit-Reset we will honor. A longer delay stops retrying immediately.

__post_init__()

Validate the policy values.

Raises:

Type Description
ValueError

If a value is negative (or max_retries is not an integer) or retry_statuses contains something that is not an HTTP status code.