Skip to content

Commit 99d651f

Browse files
authored
fix(commands): close RabbitMQ channel and connection on shutdown (#1142)
1 parent 7763a7d commit 99d651f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/aleph/commands.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ async def main(args: List[str]) -> None:
140140
session_factory = make_session_factory(engine)
141141

142142
mq_conn = await make_mq_conn(config)
143+
stack.push_async_callback(safe_async_cleanup, "mq connection", mq_conn.close())
143144
mq_channel = await mq_conn.channel()
145+
stack.push_async_callback(safe_async_cleanup, "mq channel", mq_channel.close())
144146

145147
node_cache = await init_node_cache(config)
146148
await stack.enter_async_context(node_cache)

0 commit comments

Comments
 (0)