Skip to main content

retry_once

Task that fails and is retried. Returns the number of retries.

def retry_once(
self: Task,
*args: any,
expires: float,
max_retries: integer,
countdown: float
) - > integer

Task that fails and is retried. Returns the number of retries.

Parameters

NameTypeDescription
selfTaskThe Celery task instance bound to the function
*argsanyVariable positional arguments passed to the task
expiresfloatThe expiration time in seconds for the retried task instance
max_retriesintegerThe maximum number of times the task should be retried before failing permanently
countdownfloatThe delay in seconds to wait before executing the retried task

Returns

TypeDescription
integerThe current number of retries performed by the task instance