django_celery_results.managers — django_celery_results 1.0.0 documentation

# `django_celery_results.managers`

class `django_celery_results.managers.` `TaskResultManager`

  Manager for `celery.models.TaskResult` models.

  `connection_for_read`()
  `connection_for_write`()
  `current_engine`()
  `delete_expired`(expires)

    Delete all expired results.

  `get_all_expired`(expires)

    Get all expired task results.

  `get_task`(task_id)

    Get result for task by `task_id`.

    Keyword Arguments:
    | 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`(*args, **kwargs)

    Store the result and status of a task.

    Parameters: | 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. 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.
    Keyword Arguments:
    | 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.

  `warn_if_repeatable_read`()

exception `django_celery_results.managers.` `TxIsolationWarning`

`django_celery_results.managers.` `transaction_retry`(max_retries=1)

  Decorator for functions doing database operations, adding retrying if the oepration fails.

  Keyword Arguments:
  | max_retries (int) – Maximum number of retries. Default one retry.