[hooks] Return early in server_startup hooks if the repository has not tasks manager
--- a/cubicweb/hooks/__init__.py Tue Feb 28 16:05:00 2017 +0100
+++ b/cubicweb/hooks/__init__.py Tue Feb 28 16:11:17 2017 +0100
@@ -29,6 +29,8 @@
events = ('server_startup',)
def __call__(self):
+ if self.repo._tasks_manager is None:
+ return
# XXX use named args and inner functions to avoid referencing globals
# which may cause reloading pb
lifetime = timedelta(days=self.repo.config['keep-transaction-lifetime'])
@@ -49,6 +51,8 @@
events = ('server_startup',)
def __call__(self):
+ if self.repo._tasks_manager is None:
+ return
def update_feeds(repo):
# take a list to avoid iterating on a dictionary whose size may
# change
@@ -71,6 +75,8 @@
events = ('server_startup',)
def __call__(self):
+ if self.repo._tasks_manager is None:
+ return
def expire_dataimports(repo=self.repo):
for uri, source in repo.sources_by_uri.items():
if (uri == 'system'