# `django_celery_results.backends.database`

class django_celery_results.backends.database.DatabaseBackend(app, serializer=None, max_cached_results=None, accept=None, expires=None, expires_type=None, url=None, **kwargs)

  The Django database backend, using models to store task state.

  GroupModel

    alias of `GroupResult`

  TaskModel

    alias of `TaskResult`

  apply_chord(header_result_args, body, **kwargs)

    Add a ChordCounter with the expected number of results

  cleanup()

    Delete expired metadata.

  decode_content(obj, content)
  encode_content(data)
  exception_safe_to_retry(exc)

    Check if an exception is safe to retry.

    Backends have to overload this method with correct predicates dealing with their exceptions.

    By default no exception is safe to retry, it’s up to backend implementation to define which exceptions are safe.

    For Celery / django-celery-results, retry Django / Psycopg2 InterfaceErrors, like “Connection already closed”, with new connection.

    Set result_backend_always_retry to True in order to enable retries.

  on_chord_part_return(request, state, result, **kwargs)

    Called on finishing each part of a Chord header

  subpolling_interval = 0.5

    Time to sleep between polling each individual item in ResultSet.iterate. as opposed to the interval argument which is for each pass.

django_celery_results.backends.database.trigger_callback(app, callback, group_result)

  Add the callback to the queue or mark the callback as failed Implementation borrowed from celery.app.builtins.unlock_chord