From 94c432cf6c235a4ba9c22bff39a58bd970f1aa03 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Mon, 19 Aug 2024 11:04:40 -0700 Subject: [PATCH] Updates timeout type --- bittensor/dendrite.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bittensor/dendrite.py b/bittensor/dendrite.py index dca513e0b2..3341d15ddf 100644 --- a/bittensor/dendrite.py +++ b/bittensor/dendrite.py @@ -23,6 +23,7 @@ import uuid import time import aiohttp +from aiohttp import ClientTimeout import bittensor from typing import Optional, List, Union, AsyncGenerator, Any @@ -521,7 +522,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() @@ -603,7 +604,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