django_celery_results.managers

Model managers.

class django_celery_results.managers.GroupResultManager(*args, **kwargs)[source]

Manager for celery.models.GroupResult models.

get_group(group_id)[source]

Get result for group by group_id.

exception_retry_count (int): How many times to retry by

transaction rollback on exception. This could happen in a race condition if another worker is trying to create the same task. The default is to retry once.

store_group_result(content_type, content_encoding, group_id, result, using=None)[source]
class django_celery_results.managers.ResultManager(*args, **kwargs)[source]

Generic manager for celery results.

connection_for_read()[source]
connection_for_write()[source]
current_engine()[source]
delete_expired(expires)[source]

Delete all expired results.

get_all_expired(expires)[source]

Get all expired results.

warn_if_repeatable_read()[source]
class django_celery_results.managers.TaskResultManager(*args, **kwargs)[source]

Manager for celery.models.TaskResult models.

get_task(task_id)[source]

Get result for task by task_id.

exception_retry_count (int): How many times to retry by

transaction rollback on exception. This could happen in a race condition if another worker is trying to create the same task. The default is to retry once.

store_result(content_type, content_encoding, task_id, result, status, traceback=None, meta=None, task_name=None, task_args=None, task_kwargs=None, worker=None, using=None)[source]

Store the result and status of a task.

content_type (str): Mime-type of result and meta content. content_encoding (str): Type of encoding (e.g. binary/utf-8). task_id (str): Id of task. task_name (str): Celery task name. task_args (str): Task arguments. task_kwargs (str): Task kwargs. result (str): The serialized return value of the task,

or an exception instance raised by the task.

status (str): Task status. See celery.states for a list of

possible status values.

worker (str): Worker that executes the task. using (str): Django database connection to use. traceback (str): The traceback string taken at the point of

exception (only passed if the task failed).

meta (str): Serialized result meta data (this contains e.g.

children).

exception_retry_count (int): How many times to retry by

transaction rollback on exception. This could happen in a race condition if another worker is trying to create the same task. The default is to retry twice.

exception django_celery_results.managers.TxIsolationWarning[source]

Warning emitted if the transaction isolation level is suboptimal.

django_celery_results.managers.transaction_retry(max_retries=1)[source]

Decorate a function to retry database operations.

For functions doing database operations, adding retrying if the operation fails.

max_retries (int): Maximum number of retries. Default one retry.