Skip to main content

Task

Task result/status.

Attributes​

AttributeTypeDescription
idintegerPrimary key identifier for the task record, utilizing a dialect-specific integer sequence.
task_idstringUnique string identifier for the specific Celery task instance.
statusstring = PENDINGCurrent execution state of the task, such as PENDING or SUCCESS.
resultPickleTypeThe pickled return value or exception object produced by the task execution.
date_donedatetime = _get_utc_nowThe UTC timestamp indicating when the task reached a terminal state.
tracebacktextThe full string representation of the stack trace if the task failed.

Constructor​

Signature​

def Task(
task_id: string
) - > null

Parameters​

NameTypeDescription
task_idstringThe unique identifier for the task.

Signature​

def Task(
task_id: string
) - > null

Parameters​

NameTypeDescription
task_idstringThe unique string identifier for the Celery task to be tracked.

Methods​


to_dict()​

@classmethod
def to_dict() - > object

Converts the task metadata into a dictionary format suitable for serialization.

Returns​

TypeDescription
objectA dictionary containing the task_id, status, result, traceback, and completion date.

configure()​

@classmethod
def configure(
schema: string,
name: string
) - > null

Configures the database schema and table name for the Task model at runtime.

Parameters​

NameTypeDescription
schemastringThe database schema name where the task metadata table should reside.
namestringAn optional override for the database table name; defaults to 'celery_taskmeta'.

Returns​

TypeDescription
nullNone