Updated exit handler
This commit is contained in:
parent
712273dd14
commit
ce270f4615
@ -402,6 +402,7 @@ def link_closed(link):
|
|||||||
else:
|
else:
|
||||||
RNS.log("Link closed, exiting now")
|
RNS.log("Link closed, exiting now")
|
||||||
|
|
||||||
|
RNS.Reticulum.exit_handler()
|
||||||
time.sleep(1.5)
|
time.sleep(1.5)
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
|
@ -26,6 +26,11 @@ class Reticulum:
|
|||||||
storagepath = ""
|
storagepath = ""
|
||||||
cachepath = ""
|
cachepath = ""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def exit_handler():
|
||||||
|
RNS.Transport.exitHandler()
|
||||||
|
RNS.Identity.exitHandler()
|
||||||
|
|
||||||
def __init__(self,configdir=None):
|
def __init__(self,configdir=None):
|
||||||
if configdir != None:
|
if configdir != None:
|
||||||
Reticulum.configdir = configdir
|
Reticulum.configdir = configdir
|
||||||
@ -59,8 +64,7 @@ class Reticulum:
|
|||||||
|
|
||||||
RNS.Transport.start()
|
RNS.Transport.start()
|
||||||
|
|
||||||
atexit.register(RNS.Transport.exitHandler)
|
atexit.register(Reticulum.exit_handler)
|
||||||
atexit.register(RNS.Identity.exitHandler)
|
|
||||||
|
|
||||||
def applyConfig(self):
|
def applyConfig(self):
|
||||||
if "logging" in self.config:
|
if "logging" in self.config:
|
||||||
|
Loading…
Reference in New Issue
Block a user