mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 10:19:02 +00:00
Improve tray manager handling, particularly on macOS #1825
* On shutdown, message tray manager before lengthy project shutdown * When dead ports are found, explicitly update the menu
This commit is contained in:
1 parent
9f9700a503
commit
430fc62e72
3 files changed
+12
-6
No files matched your search
+5
-4
@@ -1472,10 +1472,7 @@ class SerenaAgent:
|
||||
Shutdown handler of the agent, freeing resources and stopping background tasks.
|
||||
"""
|
||||
log.info("SerenaAgent is shutting down ...")
|
||||
if self._active_project is not None:
|
||||
log.info(f"Shutting down active project '{self._active_project.project_name}' ...")
|
||||
self._active_project.shutdown(timeout=timeout)
|
||||
self._active_project = None
|
||||
# apply shutdown depending on allocated resources, handling quick ones first (dashboard manager & GUI viewer)
|
||||
if self._gui_log_viewer:
|
||||
log.info("Stopping the GUI log window ...")
|
||||
self._gui_log_viewer.stop()
|
||||
@@ -1483,6 +1480,10 @@ class SerenaAgent:
|
||||
if self._dashboard_manager:
|
||||
self._dashboard_manager.shutdown()
|
||||
self._dashboard_manager = None
|
||||
if self._active_project is not None:
|
||||
log.info(f"Shutting down active project '{self._active_project.project_name}' ...")
|
||||
self._active_project.shutdown(timeout=timeout)
|
||||
self._active_project = None
|
||||
|
||||
def shutdown(self) -> None:
|
||||
"""
|
||||
|
||||
@@ -1155,6 +1155,7 @@ class SerenaDashboardTrayManager:
|
||||
for port in dead_ports:
|
||||
self._instances.pop(port, None)
|
||||
log.info("Removed unreachable instance on port %d", port)
|
||||
self._update_menu()
|
||||
|
||||
# terminate if no instances remain
|
||||
with self._lock:
|
||||
|
||||
Reference in new issue
Block a user