[object Object]

← back to Exo

connect with 5 sec timeout

4c4d8d2e7ab663ed7e879d17a190dc597b06308e · 2024-09-24 00:00:37 +0100 · Alex Cheema

Files touched

Diff

commit 4c4d8d2e7ab663ed7e879d17a190dc597b06308e
Author: Alex Cheema <alexcheema123@gmail.com>
Date:   Tue Sep 24 00:00:37 2024 +0100

    connect with 5 sec timeout
---
 exo/networking/grpc/grpc_peer_handle.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/exo/networking/grpc/grpc_peer_handle.py b/exo/networking/grpc/grpc_peer_handle.py
index 6b109803..7bc00eb9 100644
--- a/exo/networking/grpc/grpc_peer_handle.py
+++ b/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:

← 4db674e8 simplify health check  ·  back to Exo  ·  increase default max-generate-tokens to 10,000 7fa9f2cf →