From 997de18d78cfedafac446515b00a9e9d5f34ef71 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Sat, 3 Jan 2026 22:14:06 -0600 Subject: [PATCH] refactor(ReticulumMeshChat): extract exit logic into a separate method for improved readability --- meshchatx/meshchat.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meshchatx/meshchat.py b/meshchatx/meshchat.py index 88adfe1..09a1a4e 100644 --- a/meshchatx/meshchat.py +++ b/meshchatx/meshchat.py @@ -1834,6 +1834,9 @@ class ReticulumMeshChat: except Exception: # noqa: S110 pass + def exit_app(self, code=0): + sys.exit(code) + def get_routes(self): # This is a bit of a hack to get the routes without running the full server # It's mainly for testing purposes @@ -3257,7 +3260,7 @@ class ReticulumMeshChat: async def do_shutdown(): await asyncio.sleep(0.5) # give some time for the response to be sent await self.shutdown(None) - sys.exit(0) + self.exit_app(0) asyncio.create_task(do_shutdown()) return web.json_response({"message": "Shutting down..."})