[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.
--- 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()