|
@@ -86,7 +86,7 @@ class DatabaseBackend(BaseBackend):
|
|
|
super(DatabaseBackend, self).__init__(**kwargs)
|
|
|
conf = self.app.conf
|
|
|
self.expires = maybe_timedelta(self.prepare_expires(expires))
|
|
|
- self.dburi = url or dburi or conf.CELERY_RESULT_DBURI
|
|
|
+ self.url = url or dburi or conf.CELERY_RESULT_DBURI
|
|
|
self.engine_options = dict(
|
|
|
engine_options or {},
|
|
|
**conf.CELERY_RESULT_ENGINE_OPTIONS or {})
|
|
@@ -99,14 +99,14 @@ class DatabaseBackend(BaseBackend):
|
|
|
Task.__table__.name = tablenames.get('task', 'celery_taskmeta')
|
|
|
TaskSet.__table__.name = tablenames.get('group', 'celery_tasksetmeta')
|
|
|
|
|
|
- if not self.dburi:
|
|
|
+ if not self.url:
|
|
|
raise ImproperlyConfigured(
|
|
|
'Missing connection string! Do you have '
|
|
|
'CELERY_RESULT_DBURI set to a real value?')
|
|
|
|
|
|
def ResultSession(self, session_manager=SessionManager()):
|
|
|
return session_manager.session_factory(
|
|
|
- dburi=self.dburi,
|
|
|
+ dburi=self.url,
|
|
|
short_lived_sessions=self.short_lived_sessions,
|
|
|
**self.engine_options
|
|
|
)
|
|
@@ -195,7 +195,7 @@ class DatabaseBackend(BaseBackend):
|
|
|
|
|
|
def __reduce__(self, args=(), kwargs={}):
|
|
|
kwargs.update(
|
|
|
- dict(dburi=self.dburi,
|
|
|
+ dict(dburi=self.url,
|
|
|
expires=self.expires,
|
|
|
engine_options=self.engine_options))
|
|
|
return super(DatabaseBackend, self).__reduce__(args, kwargs)
|