fix(remote): close a session channel whose loop already ended

This commit is contained in:
imSp4rky
2026-11-24 18:30:58 -07:00
parent 83e5c88f6f
commit cdeeba17ab
2 changed files with 19 additions and 2 deletions
+2 -1
View File
@@ -468,7 +468,8 @@ class WebSocketChannel:
def close(self) -> None:
if self.loop and self.task and self.thread.is_alive():
self.loop.call_soon_threadsafe(self.task.cancel)
with contextlib.suppress(RuntimeError): # the loop closes before its thread ends
self.loop.call_soon_threadsafe(self.task.cancel)
self.thread.join(5)
self.fallback.close()
self.messages.close_cdm_sessions()