Skip to content

Commit

Permalink
fix: add missing silverback_shutdown task exec in runner
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshultz committed Nov 18, 2023
1 parent ec43642 commit 8d2427c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions silverback/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ async def run(self):

await asyncio.gather(*tasks)

# Execute Silverback shutdown task before shutting down the broker
if shutdown_handler := self.app.get_shutdown_handler():
task = await shutdown_handler.kiq()
result = await task.wait_result()
await self._handle_result(
"silverback_shutdown",
self.last_block_seen,
-1,
result,
)

await self.app.broker.shutdown()


Expand Down

0 comments on commit 8d2427c

Please sign in to comment.