Skip to content

Commit dec5bab

Browse files
Fix Hasura healthcheck (#46)
1 parent 4b7aab2 commit dec5bab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dipdup/hasura.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from contextlib import suppress
66
from typing import Any, Dict, Iterator, List, Tuple, Type
77

8+
import aiohttp
89
from aiohttp import ClientConnectorError, ClientOSError
910
from tortoise import Model, fields
1011

@@ -148,8 +149,9 @@ async def configure_hasura(config: DipDupConfig):
148149
_logger.info('Waiting for Hasura instance to be healthy')
149150
for _ in range(60):
150151
with suppress(ClientConnectorError, ClientOSError):
151-
await http_request('get', url=f'{url}/healthz')
152-
break
152+
async with aiohttp.ClientSession() as session:
153+
await session.get(f'{url}/healthz')
154+
break
153155
await asyncio.sleep(1)
154156
else:
155157
_logger.error('Hasura instance not responding for 60 seconds')

0 commit comments

Comments
 (0)