MCPcopy Create free account
hub / github.com/StackStorm/st2 / _run_worker

Function _run_worker

st2reactor/st2reactor/cmd/timersengine.py:64–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62
63
64def _run_worker():
65 LOG.info("(PID=%s) TimerEngine started.", os.getpid())
66
67 timer = None
68
69 try:
70 timer_thread = None
71 if cfg.CONF.timer.enable or cfg.CONF.timersengine.enable:
72 local_tz = (
73 cfg.CONF.timer.local_timezone or cfg.CONF.timersengine.local_timezone
74 )
75 timer = St2Timer(local_timezone=local_tz)
76 timer_thread = concurrency.spawn(_kickoff_timer, timer)
77 LOG.info(TIMER_ENABLED_LOG_LINE)
78 return timer_thread.wait()
79 else:
80 LOG.info(TIMER_DISABLED_LOG_LINE)
81 except (KeyboardInterrupt, SystemExit):
82 LOG.info("(PID=%s) TimerEngine stopped.", os.getpid())
83 deregister_service(TIMER_ENGINE)
84 except:
85 LOG.exception("(PID:%s) TimerEngine quit due to exception.", os.getpid())
86 return 1
87 finally:
88 if timer:
89 timer.cleanup()
90
91 return 0
92
93
94def main():

Callers 1

mainFunction · 0.70

Calls 4

cleanupMethod · 0.95
St2TimerClass · 0.90
deregister_serviceFunction · 0.90
waitMethod · 0.45

Tested by

no test coverage detected