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

Function _setup_sigterm_handler

st2actions/st2actions/cmd/actionrunner.py:41–48  ·  view source on GitHub ↗
(action_worker)

Source from the content-addressed store, hash-verified

39
40
41def _setup_sigterm_handler(action_worker):
42 def sigterm_handler(signum=None, frame=None):
43 # This will cause SystemExit to be throw and allow for component cleanup.
44 action_worker.kill()
45
46 # Register a SIGTERM signal handler which calls sys.exit which causes SystemExit to
47 # be thrown. We catch SystemExit and handle cleanup there.
48 signal.signal(signal.SIGTERM, sigterm_handler)
49
50
51def _setup():

Callers 1

_run_workerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected