From e9c5393a0c9ab5ebbff2a97a208b0d0b990d9b99 Mon Sep 17 00:00:00 2001 From: Lev Gorodetskiy Date: Tue, 18 May 2021 09:57:09 +0300 Subject: [PATCH] Fix Hasura healthcheck --- src/dipdup/hasura.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dipdup/hasura.py b/src/dipdup/hasura.py index 290775eb5..4541f024c 100644 --- a/src/dipdup/hasura.py +++ b/src/dipdup/hasura.py @@ -5,6 +5,7 @@ from contextlib import suppress from typing import Any, Dict, Iterator, List, Tuple, Type +import aiohttp from aiohttp import ClientConnectorError, ClientOSError from tortoise import Model, fields @@ -148,8 +149,9 @@ async def configure_hasura(config: DipDupConfig): _logger.info('Waiting for Hasura instance to be healthy') for _ in range(60): with suppress(ClientConnectorError, ClientOSError): - await http_request('get', url=f'{url}/healthz') - break + async with aiohttp.ClientSession() as session: + await session.get(f'{url}/healthz') + break await asyncio.sleep(1) else: _logger.error('Hasura instance not responding for 60 seconds')