From 7b0b0598e9fa435c84e5d19bf6cc1527868b7ef2 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Thu, 1 Aug 2024 13:50:22 -0700 Subject: [PATCH] Adds updated type in timeouts dendrite --- bittensor/dendrite.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bittensor/dendrite.py b/bittensor/dendrite.py index 61aa83663e..683ac595a5 100644 --- a/bittensor/dendrite.py +++ b/bittensor/dendrite.py @@ -26,6 +26,7 @@ # 3rd Party import aiohttp +from aiohttp import ClientTimeout # Application import bittensor @@ -557,7 +558,7 @@ async def call( url, headers=synapse.to_headers(), json=synapse.model_dump(), - timeout=timeout, + timeout=ClientTimeout(total=timeout), ) as response: # Extract the JSON response from the server json_response = await response.json() @@ -636,7 +637,7 @@ async def call_stream( url, headers=synapse.to_headers(), json=synapse.model_dump(), - timeout=timeout, + timeout=ClientTimeout(total=timeout), ) as response: # Use synapse subclass' process_streaming_response method to yield the response chunks async for chunk in synapse.process_streaming_response(response): # type: ignore