refactor(ReticulumMeshChat): extract exit logic into a separate method for improved readability

This commit is contained in:
2026-01-03 22:14:06 -06:00
parent 7f30ffe07a
commit 997de18d78

View File

@@ -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..."})