celery.backends.mongodb

MongoDB result store backend.

class celery.backends.mongodb.MongoBackend(app=None, **kwargs)[源代码]

MongoDB result backend.

抛出:

celery.exceptions.ImproperlyConfigured -- if module https://pypi.org/project/pymongo/ is not available.

as_uri(include_password=False)[源代码]

Return the backend as an URI.

参数:

include_password (bool) -- Password censored if disabled.

cleanup()[源代码]

Delete expired meta-data.

property collection

Get the meta-data task collection.

property database

Get database from MongoDB connection.

performs authentication if necessary.

database_name = 'celery'
decode(data)[源代码]
encode(data)[源代码]
property expires_delta
property group_collection

Get the meta-data task collection.

groupmeta_collection = 'celery_groupmeta'
host = 'localhost'
max_pool_size = 10
mongo_host = None
options = None
password = None
port = 27017
supports_autoexpire = False

If true the backend must automatically expire results. The daily backend_cleanup periodic task won't be triggered in this case.

taskmeta_collection = 'celery_taskmeta'
user = None