Skip to content

Commit 84e9b75

Browse files
authored
system/ui: fix WiFi manager shutdown task errors (commaai#35204)
fix WiFi manager shutdown task errors
1 parent f1c0109 commit 84e9b75

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

system/ui/lib/wifi_manager.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ async def shutdown(self) -> None:
115115
except asyncio.CancelledError:
116116
pass
117117
if self.bus:
118-
await self.bus.disconnect()
118+
self.bus.disconnect()
119119

120120
async def request_scan(self) -> None:
121121
try:
@@ -634,8 +634,10 @@ def _run(self):
634634

635635
def shutdown(self) -> None:
636636
if self._running:
637-
if self._manager is not None:
638-
self._run_coroutine(self._manager.shutdown())
637+
if self._manager is not None and self._loop:
638+
shutdown_future = asyncio.run_coroutine_threadsafe(self._manager.shutdown(), self._loop)
639+
shutdown_future.result(timeout=3.0)
640+
639641
if self._loop and self._loop.is_running():
640642
self._loop.call_soon_threadsafe(self._loop.stop)
641643
if self._thread and self._thread.is_alive():

0 commit comments

Comments
 (0)