Skip to main content

Retry

The task is to be retried later.

Attributes

AttributeTypeDescription
messagestring = NoneOptional message describing context of retry.
excException = NoneException (if any) that caused the retry to happen.
when`numbers.Realdatetime.datetime` = None

Constructor

Signature

def Retry(
message: string = None,
exc: Exception|string = None,
when: numbers.Real|datetime.datetime = None,
is_eager: boolean = False,
sig: [Signature](../canvas/signature.md?sid=celery_canvas_signature) = None,
**kwargs: dict
) - > null

Parameters

NameTypeDescription
messagestring = NoneOptional message describing the context of the retry.
exc`Exceptionstring` = None
when`numbers.Realdatetime.datetime` = None
is_eagerboolean = FalseFlag indicating if the task is being executed eagerly.
sig[Signature](../canvas/signature.md?sid=celery_canvas_signature) = NoneThe signature of the task being retried.
**kwargsdictAdditional keyword arguments passed to the parent TaskPredicate class.

Methods


humanize()

@classmethod
def humanize() - > string

Converts the retry schedule into a human-readable string format. Returns a relative time string if the schedule is a number, or an absolute time string otherwise.

Returns

TypeDescription
stringA string describing the retry time, formatted as either 'in [seconds]s' or 'at [timestamp]'