[server] Exit quickly when a looping task is registered in maintenance mode
In such cases the repository will not have a scheduler on purpose because the
repository will not be kept running and will quickly shutdown after migration
so that it's undesirable to have looping tasks being executed.
--- a/cubicweb/server/repository.py Fri Mar 24 14:56:48 2017 +0100
+++ b/cubicweb/server/repository.py Wed Mar 29 11:31:02 2017 +0200
@@ -405,6 +405,8 @@
looping tasks can only be registered during repository initialization,
once done this method will fail.
"""
+ if self.config.repairing:
+ return
assert self._scheduler is not None, \
"This Repository is not intended to be used as a server"
event = utils.schedule_periodic_task(