Browse Source

connect with 5 sec timeout

Alex Cheema 9 tháng trước cách đây
mục cha
commit
4c4d8d2e7a

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

@@ -46,8 +46,7 @@ class GRPCPeerHandle(PeerHandle):
     self.stub = None
     self.stub = None
 
 
   async def _ensure_connected(self):
   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:
   async def health_check(self) -> bool:
     try:
     try: