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

Function setup_sigterm_handler

st2actions/st2actions/cmd/workflow_engine.py:42–49  ·  view source on GitHub ↗
(engine)

Source from the content-addressed store, hash-verified

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

Callers 1

run_serverFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected