We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89e9d57 commit 21e054eCopy full SHA for 21e054e
1 file changed
src/opengradient/client/tee_connection.py
@@ -153,8 +153,10 @@ def _connect(self) -> ActiveTEE:
153
async def reconnect(self) -> None:
154
"""Connect to a new TEE from the registry and rebuild the HTTP client."""
155
async with self._refresh_lock:
156
+ old_client = self._active.http_client
157
+ self._active = self._connect()
158
try:
- self._active = self._connect()
159
+ await old_client.aclose()
160
except Exception:
161
logger.debug("Failed to close previous HTTP client during TEE refresh.", exc_info=True)
162
@@ -198,3 +200,4 @@ async def close(self) -> None:
198
200
self._refresh_task.cancel()
199
201
self._refresh_task = None
202
await self._active.http_client.aclose()
203
+
0 commit comments