We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6268cb7 commit 9a72d37Copy full SHA for 9a72d37
1 file changed
taskiq_aiogram/initializer.py
@@ -61,7 +61,7 @@ async def startup(state: TaskiqState) -> None:
61
broker.add_dependency_context(
62
{
63
Dispatcher: dispatcher,
64
- Bot: bots[0],
+ Bot: bots[-1],
65
List[Bot]: bots,
66
},
67
)
@@ -93,7 +93,7 @@ async def shutdown(state: TaskiqState) -> None:
93
dispatcher: Dispatcher = state[DISPATCHER_KEY]
94
95
try:
96
- await dispatcher.emit_shutdown(bots[0], **workflow_data)
+ await dispatcher.emit_shutdown(bots[-1], **workflow_data)
97
except Exception as exc:
98
logger.warn(f"Error found while shutting down: {exc}")
99
0 commit comments