[pyramid] Drop call to repository's start_looping_tasks method and warn about this
authorDenis Laxalde <denis.laxalde@logilab.fr>
Mon, 06 Mar 2017 13:49:51 +0100
changeset 12003 5236ce988805
parent 12002 26453d9467f6
child 12005 dcf80f5b7b63
[pyramid] Drop call to repository's start_looping_tasks method and warn about this We are about to drop the start_looping_tasks method and running "looping tasks" along the WSGI application is not a very good idea. So issue a warning pointing to the forthcoming "scheduler" command. Related to #17057223.
cubicweb/pyramid/pyramidctl.py
--- a/cubicweb/pyramid/pyramidctl.py	Mon Mar 06 15:22:16 2017 +0100
+++ b/cubicweb/pyramid/pyramidctl.py	Mon Mar 06 13:49:51 2017 +0100
@@ -35,6 +35,7 @@
 import time
 import threading
 import subprocess
+import warnings
 
 from cubicweb import ExecutionError
 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg
@@ -338,8 +339,11 @@
         host = cwconfig['interface']
         port = cwconfig['port'] or 8080
         repo = app.application.registry['cubicweb.repository']
+        warnings.warn(
+            'the "pyramid" command does not start repository "looping tasks" '
+            'anymore; use the standalone "scheduler" command if needed'
+        )
         try:
-            repo.start_looping_tasks()
             waitress.serve(app, host=host, port=port)
         finally:
             repo.shutdown()