diff --git a/app.py b/app.py index 3e561ae..81dae85 100644 --- a/app.py +++ b/app.py @@ -13,7 +13,8 @@ def sigterm_handler_wrap(_signo): def func(_signo, _stack_frame): logger.info("signal {} received, exiting...".format(_signo)) conf().save_user_datas() - return old_handler(_signo, _stack_frame) + if callable(old_handler): # check old_handler + return old_handler(_signo, _stack_frame) signal.signal(_signo, func) def run():