Skip to content

Commit 9a72d37

Browse files
committed
Fixed primary bot selection.
Signed-off-by: Pavel Kirilin <win10@list.ru>
1 parent 6268cb7 commit 9a72d37

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

taskiq_aiogram/initializer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async def startup(state: TaskiqState) -> None:
6161
broker.add_dependency_context(
6262
{
6363
Dispatcher: dispatcher,
64-
Bot: bots[0],
64+
Bot: bots[-1],
6565
List[Bot]: bots,
6666
},
6767
)
@@ -93,7 +93,7 @@ async def shutdown(state: TaskiqState) -> None:
9393
dispatcher: Dispatcher = state[DISPATCHER_KEY]
9494

9595
try:
96-
await dispatcher.emit_shutdown(bots[0], **workflow_data)
96+
await dispatcher.emit_shutdown(bots[-1], **workflow_data)
9797
except Exception as exc:
9898
logger.warn(f"Error found while shutting down: {exc}")
9999

0 commit comments

Comments
 (0)