Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/opengradient/client/tee_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,14 @@ def _connect(self) -> ActiveTEE:
async def reconnect(self) -> None:
"""Connect to a new TEE from the registry and rebuild the HTTP client."""
async with self._refresh_lock:
old_client = self._active.http_client
try:
self._active = self._connect()
except Exception:
logger.debug("Failed to reconnect TEE.", exc_info=True)
return
try:
await old_client.aclose()
except Exception:
logger.debug("Failed to close previous HTTP client during TEE refresh.", exc_info=True)

Expand Down
Loading