Browse Source

fix: no old signal handler

master
lanvent 1 year ago
parent
commit
f1e8344beb
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      app.py

+ 2
- 1
app.py View File

@@ -13,7 +13,8 @@ def sigterm_handler_wrap(_signo):
def func(_signo, _stack_frame): def func(_signo, _stack_frame):
logger.info("signal {} received, exiting...".format(_signo)) logger.info("signal {} received, exiting...".format(_signo))
conf().save_user_datas() 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) signal.signal(_signo, func)


def run(): def run():


Loading…
Cancel
Save