Skip to content

Commit adc80fc

Browse files
authored
Merge pull request #11 from UiPath/fix/samples
fix: proper ws cleanup
2 parents b4e1cc5 + 6631725 commit adc80fc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-mcp"
3-
version = "0.0.6"
3+
version = "0.0.7"
44
description = "UiPath MCP SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath_mcp/_cli/_runtime/_runtime.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,13 @@ async def cleanup(self) -> None:
273273

274274
self.session_servers.clear()
275275

276-
if self.signalr_client:
277-
# Close the SignalR connection
278-
await self.signalr_client._transport._ws.close()
276+
if self.signalr_client and hasattr(self.signalr_client, "_transport"):
277+
transport = self.signalr_client._transport
278+
if transport and hasattr(transport, "_ws") and transport._ws:
279+
try:
280+
await transport._ws.close()
281+
except Exception as e:
282+
logger.error(f"Error closing SignalR WebSocket: {str(e)}")
279283

280284
# Add a small delay to allow the server to shut down gracefully
281285
if sys.platform == "win32":

0 commit comments

Comments
 (0)