1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2025-07-07 06:36:23 +00:00

Move signal handling to new module

This commit is contained in:
R. Richard
2019-07-08 11:42:03 +02:00
committed by therealkrispet
parent 417a848328
commit ef2ab5d0bf
3 changed files with 15 additions and 16 deletions

View File

@ -1,10 +1,8 @@
import logging
from sys import stderr
from signal import signal, SIGTERM, SIGINT
from tornado.ioloop import IOLoop
from tfw.builtins import EventHandler
from tfw.builtins import PipeIOEventHandler
from tfw.config import TFWENV
from tfw.logging import Log, Logger, LogFormatter, VerboseLogFormatter
@ -15,6 +13,7 @@ from pipe_io_auxlib import (
DeployPipeIOEventHandler, IdePipeIOEventHandler,
FSMPipeIOEventHandler
)
from signal_handling import setup_signal_handlers
LOG = logging.getLogger(__name__)
@ -67,12 +66,7 @@ def main():
'/tmp/tfw_fsm_recv'
)
def stop(*_):
EventHandler.stop_all_instances()
exit(0)
signal(SIGTERM, stop)
signal(SIGINT, stop)
setup_signal_handlers()
IOLoop.instance().start()