daemon: fixed issue in some cases where core-gui would have a session reach shutdown state, without formally shutting down and removing the session directory
This commit is contained in:
parent
49659976d3
commit
1b025c47da
1 changed files with 7 additions and 11 deletions
|
@ -134,7 +134,6 @@ class Session:
|
|||
self.link_handlers: List[Callable[[LinkData], None]] = []
|
||||
self.file_handlers: List[Callable[[FileData], None]] = []
|
||||
self.config_handlers: List[Callable[[ConfigData], None]] = []
|
||||
self.shutdown_handlers: List[Callable[[Session], None]] = []
|
||||
|
||||
# session options/metadata
|
||||
self.options: SessionConfig = SessionConfig()
|
||||
|
@ -771,20 +770,17 @@ class Session:
|
|||
"""
|
||||
if self.state == EventTypes.SHUTDOWN_STATE:
|
||||
logging.info("session(%s) state(%s) already shutdown", self.id, self.state)
|
||||
return
|
||||
logging.info("session(%s) state(%s) shutting down", self.id, self.state)
|
||||
self.set_state(EventTypes.SHUTDOWN_STATE, send_event=True)
|
||||
# clear out current core session
|
||||
self.clear()
|
||||
# shutdown sdt
|
||||
self.sdt.shutdown()
|
||||
else:
|
||||
logging.info("session(%s) state(%s) shutting down", self.id, self.state)
|
||||
self.set_state(EventTypes.SHUTDOWN_STATE, send_event=True)
|
||||
# clear out current core session
|
||||
self.clear()
|
||||
# shutdown sdt
|
||||
self.sdt.shutdown()
|
||||
# remove this sessions working directory
|
||||
preserve = self.options.get_config("preservedir") == "1"
|
||||
if not preserve:
|
||||
shutil.rmtree(self.session_dir, ignore_errors=True)
|
||||
# call session shutdown handlers
|
||||
for handler in self.shutdown_handlers:
|
||||
handler(self)
|
||||
|
||||
def broadcast_event(self, event_data: EventData) -> None:
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue