Skip to content

Commit f276cd7

Browse files
fix: close server only when thread-safe
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 17ea054 commit f276cd7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/gh/components/DF_websocket_listener

‎src/gh/components/DF_websocket_listener/code.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def RunScript(self,
5353
loop = sc.sticky.pop(f'{prefix}_loop', None)
5454
if server and loop:
5555
try:
56-
server.close()
56+
loop.call_soon_threadsafe(server.close)
5757
asyncio.run_coroutine_threadsafe(server.wait_closed(), loop)
5858
logs.append("WebSocket server close initiated")
5959
except Exception as e:

0 commit comments

Comments
 (0)