cubicweb/pyramid/pyramidctl.py
changeset 12729 c8ca784fdd77
parent 12602 2beda828c1bf
child 12730 6c48a49cd3c2
equal deleted inserted replaced
12724:a6b12f31930c 12729:c8ca784fdd77
    31 import signal
    31 import signal
    32 import sys
    32 import sys
    33 import time
    33 import time
    34 import threading
    34 import threading
    35 import subprocess
    35 import subprocess
    36 import warnings
       
    37 
    36 
    38 from cubicweb import ExecutionError
    37 from cubicweb import ExecutionError
    39 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg
    38 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg
    40 from cubicweb.cwctl import CWCTL, InstanceCommand, init_cmdline_log_threshold
    39 from cubicweb.cwctl import CWCTL, InstanceCommand, init_cmdline_log_threshold
    41 from cubicweb.pyramid import wsgi_application_from_cwconfig
    40 from cubicweb.pyramid import wsgi_application_from_cwconfig
   380         host = cwconfig['interface']
   379         host = cwconfig['interface']
   381         port = cwconfig['port'] or 8080
   380         port = cwconfig['port'] or 8080
   382         url_scheme = ('https' if cwconfig['base-url'].startswith('https')
   381         url_scheme = ('https' if cwconfig['base-url'].startswith('https')
   383                       else 'http')
   382                       else 'http')
   384         repo = app.application.registry['cubicweb.repository']
   383         repo = app.application.registry['cubicweb.repository']
   385         warnings.warn(
       
   386             'the "pyramid" command does not start repository "looping tasks" '
       
   387             'anymore; use the standalone "scheduler" command if needed'
       
   388         )
       
   389         try:
   384         try:
   390             waitress.serve(app, host=host, port=port, url_scheme=url_scheme,
   385             waitress.serve(app, host=host, port=port, url_scheme=url_scheme,
   391                            clear_untrusted_proxy_headers=True)
   386                            clear_untrusted_proxy_headers=True)
   392         finally:
   387         finally:
   393             repo.shutdown()
   388             repo.shutdown()