Browse Source

connect with 5 sec timeout

Alex Cheema 7 months ago
parent
commit
4c4d8d2e7a
1 changed files with 1 additions and 2 deletions
  1. 1 2
      exo/networking/grpc/grpc_peer_handle.py

+ 1 - 2
exo/networking/grpc/grpc_peer_handle.py

@@ -46,8 +46,7 @@ class GRPCPeerHandle(PeerHandle):
     self.stub = None
 
   async def _ensure_connected(self):
-    if not await self.is_connected():
-      await self.connect()
+    if not await self.is_connected(): await asyncio.wait_for(self.connect(), timeout=5)
 
   async def health_check(self) -> bool:
     try: