|
@@ -38,6 +38,13 @@ __all__ = ['MongoBackend']
|
|
|
|
|
|
|
|
|
class MongoBackend(BaseBackend):
|
|
|
+ """MongoDB result backend.
|
|
|
+
|
|
|
+ :raises celery.exceptions.ImproperlyConfigured: if
|
|
|
+ module :mod:`pymongo` is not available.
|
|
|
+
|
|
|
+ """
|
|
|
+
|
|
|
host = 'localhost'
|
|
|
port = 27017
|
|
|
user = None
|
|
@@ -52,12 +59,6 @@ class MongoBackend(BaseBackend):
|
|
|
_connection = None
|
|
|
|
|
|
def __init__(self, app=None, url=None, **kwargs):
|
|
|
- """Initialize MongoDB backend instance.
|
|
|
-
|
|
|
- :raises celery.exceptions.ImproperlyConfigured: if
|
|
|
- module :mod:`pymongo` is not available.
|
|
|
-
|
|
|
- """
|
|
|
self.options = {}
|
|
|
super(MongoBackend, self).__init__(app, **kwargs)
|
|
|
self.expires = kwargs.get('expires') or maybe_timedelta(
|
|
@@ -255,7 +256,7 @@ class MongoBackend(BaseBackend):
|
|
|
return self.url
|
|
|
|
|
|
if ',' not in self.url:
|
|
|
- return maybe_sanitize_url(self.url).rstrip('/')
|
|
|
+ return maybe_sanitize_url(self.url)
|
|
|
|
|
|
uri1, remainder = self.url.split(',', 1)
|
|
|
- return ','.join([maybe_sanitize_url(uri1).rstrip('/'), remainder])
|
|
|
+ return ','.join([maybe_sanitize_url(uri1), remainder])
|