Cleanup
This commit is contained in:
parent
ef2e1234a5
commit
2b7ba9558b
2 changed files with 20 additions and 12 deletions
|
|
@ -1365,7 +1365,9 @@ class LXMRouter:
|
|||
self.save_node_stats()
|
||||
|
||||
def sigint_handler(self, signal, frame):
|
||||
if threading.current_thread() != threading.main_thread(): os._exit(0)
|
||||
if threading.current_thread() != threading.main_thread():
|
||||
RNS.log(f"SIGINT on non-main thread {threading.current_thread()}, exiting immediately", RNS.LOG_WARNING)
|
||||
os._exit(0)
|
||||
else:
|
||||
if not self.exit_handler_running:
|
||||
RNS.log("Received SIGINT, shutting down now!", RNS.LOG_WARNING)
|
||||
|
|
@ -1375,7 +1377,9 @@ class LXMRouter:
|
|||
RNS.log("Received SIGINT, but exit handler is running, keeping process alive until storage persist is complete", RNS.LOG_WARNING)
|
||||
|
||||
def sigterm_handler(self, signal, frame):
|
||||
if threading.current_thread() != threading.main_thread(): os._exit(0)
|
||||
if threading.current_thread() != threading.main_thread():
|
||||
RNS.log(f"SIGTERM on non-main thread {threading.current_thread()}, exiting immediately", RNS.LOG_WARNING)
|
||||
os._exit(0)
|
||||
else:
|
||||
if not self.exit_handler_running:
|
||||
RNS.log("Received SIGTERM, shutting down now!", RNS.LOG_WARNING)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue