Skip to content

Commit ce54437

Browse files
Wait for Hasura to be configured before starting indexing (#251)
1 parent dd316ee commit ce54437

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Please use [this](https://docs.gitlab.com/ee/development/changelog.html) documen
77
### Fixed
88

99
* database: Do not add the `schema` argument to the PostgreSQL connection string when not needed.
10+
* hasura: Wait for Hasura to be configured before starting indexing.
1011

1112
## 4.2.4 - 2022-02-14
1213

src/dipdup/dipdup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ async def run(self) -> None:
352352

353353
await self._initialize_schema()
354354
await self._initialize_datasources()
355-
await self._set_up_hasura(stack, tasks)
355+
await self._set_up_hasura(stack)
356356

357357
if self._config.oneshot:
358358
start_scheduler_event, spawn_datasources_event = Event(), Event()
@@ -481,15 +481,15 @@ async def _set_up_hooks(self, tasks: Optional[Set[Task]] = None) -> None:
481481
if tasks:
482482
tasks.add(create_task(self._ctx.callbacks.run()))
483483

484-
async def _set_up_hasura(self, stack: AsyncExitStack, tasks: Set[Task]) -> None:
484+
async def _set_up_hasura(self, stack: AsyncExitStack) -> None:
485485
if not self._config.hasura:
486486
return
487487

488488
if not isinstance(self._config.database, PostgresDatabaseConfig):
489489
raise RuntimeError
490490
hasura_gateway = HasuraGateway(self._config.package, self._config.hasura, self._config.database)
491491
await stack.enter_async_context(hasura_gateway)
492-
tasks.add(create_task(hasura_gateway.configure()))
492+
await hasura_gateway.configure()
493493

494494
async def _set_up_datasources(self, stack: AsyncExitStack) -> None:
495495
await self._create_datasources()

0 commit comments

Comments
 (0)