From d33d6a4dc4453e8af945715a14807715231d1419 Mon Sep 17 00:00:00 2001 From: Tim Bendt Date: Tue, 16 Dec 2025 21:17:35 -0500 Subject: [PATCH] fix exit hanging --- .coverage | Bin 69632 -> 69632 bytes src/cli/sync_dashboard.py | 30 ++++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.coverage b/.coverage index 494a69e4480757608f679cb1123ec2eea4e158a9..68d4746a1b1af106ce372d55b394ff9d15830862 100644 GIT binary patch delta 199 zcmZozz|ydQWdmD7)Jg{aul#TMpYq@3Kg^%U_ls{iUnE~3pC_LKp9P-|?^)ihyo-24 zcs+R?c{O+ycqMoRcz*C4t5= zwQ{qdfG5}H)m{IXg9ABO895u3bgUZYD=;LS|L3}Y(Rv0329_K3Oh5_(4zLP<8B7cc t0xXO`rUOF*1BU~HfCGb|lY)Xn0|yh60|NsS!?snck|wEa{?*6U2mpIcG{^t| delta 197 zcmZozz|ydQWdmD7)M^I)ul#TMpYq@3Kg^%U_ls{OUo>AZpEsWqpB0}T?|I(syi0h) zc)fX@d9`?zc%^uScz*F5=GnzFlV>7N8&5Eg5%)#z6WklQS8$hdyL0PvGjaXmdct*u zYxQP90dKC&E4%(N2l{icGIBP`=~y+)XSuPt{^I%<+6)W~jNj%1Nhl~_WC5`n7#KL3 oKnw*22L=`e1`dS=4n+Y01qT*JMg^c2hUm~xLr None: + """Clean up when the dashboard is unmounted.""" + if self._countdown_task: + self._countdown_task.cancel() + if self._spinner_task: + self._spinner_task.cancel() + def on_list_view_selected(self, event: ListView.Selected) -> None: """Handle task selection from the list.""" if isinstance(event.item, TaskListItem): @@ -677,4 +694,13 @@ async def run_dashboard_sync(): await asyncio.sleep(1) # Run dashboard and sync loop concurrently - await asyncio.gather(dashboard.run_async(), sync_loop()) + # When dashboard exits, cancel the sync loop + sync_task = asyncio.create_task(sync_loop()) + try: + await dashboard.run_async() + finally: + sync_task.cancel() + try: + await sync_task + except asyncio.CancelledError: + pass