Skip to main content

retry_once_headers

Task that fails and is retried. Returns headers.

def retry_once_headers(
self: celery.app.task.Task,
*args: any,
max_retries: int = 1,
countdown: float = 0.1
) - > dict

Task that fails and is retried. Returns headers.

Parameters

NameTypeDescription
selfcelery.app.task.TaskThe task instance bound to the function, providing access to request context and retry logic
*argsanyVariable length argument list passed to the task
max_retriesint = 1The maximum number of times the task should be retried before failing
countdownfloat = 0.1The delay in seconds to wait before executing the retry attempt

Returns

TypeDescription
dictThe request headers from the task execution context after a successful retry