Добавил обработку ServerDisconnectedError в backoff

This commit is contained in:
grucshetskyaleksei 2023-06-22 02:48:20 +03:00
parent d0f18393ab
commit 8b55667c94

View File

@ -22,7 +22,8 @@ class EtlLoader:
self.etl = EtlConfig() self.etl = EtlConfig()
self.api_config = ApiConfig() self.api_config = ApiConfig()
@backoff.on_exception(backoff.expo, (asyncio.TimeoutError, aiohttp.ClientConnectorError,), base=2, factor=1, @backoff.on_exception(backoff.expo, (asyncio.TimeoutError, aiohttp.ClientConnectorError,
aiohttp.ServerDisconnectedError), base=2, factor=1,
max_value=int(misc_settings.max_wait_size), max_tries=None) max_value=int(misc_settings.max_wait_size), max_tries=None)
async def load_data(self, state: State, abitr: Abitr, iblock_id: int, storage: BaseStorage): async def load_data(self, state: State, abitr: Abitr, iblock_id: int, storage: BaseStorage):
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session: