4
starttime = time.time()
16
return repr(cherrypy.engine.publish("Autoreloader", "mtimes"))
20
return str(os.getpid())
24
return repr(starttime)
28
# This handler might be called before the engine is STARTED if an
29
# HTTP worker thread handles it before the HTTP server returns
30
# control to engine.start. We avoid that race condition here
31
# by waiting for the Bus to be STARTED.
32
cherrypy.engine.wait(state=cherrypy.engine.states.STARTED)
33
cherrypy.engine.exit()
37
from signal import signal, SIGTERM
41
def old_term_handler(signum=None, frame=None):
42
cherrypy.log("I am an old SIGTERM handler.")
44
signal(SIGTERM, old_term_handler)
47
if cherrypy.config.get('unsubsig', False):
48
cherrypy.engine.signal_handler.unsubscribe()
49
cherrypy.engine.subscribe('start', unsub_sig, priority=100)
53
if cherrypy.config.get('starterror', False):
55
cherrypy.engine.subscribe('start', starterror, priority=6)
58
cherrypy.tree.mount(Root(), '/', {'/': {}})