mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
update workflow data
This commit is contained in:
parent
28cc2384e8
commit
655f061007
1 changed files with 6 additions and 11 deletions
|
|
@ -511,16 +511,11 @@ class Dispatcher(Router):
|
|||
signal.SIGINT, self._signal_stop_polling, signal.SIGINT
|
||||
)
|
||||
|
||||
workflow_data = {
|
||||
"dispatcher": self,
|
||||
"bots": bots,
|
||||
**self.workflow_data,
|
||||
**kwargs,
|
||||
}
|
||||
if "bot" in workflow_data:
|
||||
workflow_data.pop("bot")
|
||||
self.workflow_data.update({"dispatcher": self, "bots": bots, **kwargs})
|
||||
if "bot" in self.workflow_data:
|
||||
self.workflow_data.pop("bot")
|
||||
|
||||
await self.emit_startup(bot=bots[-1], **workflow_data)
|
||||
await self.emit_startup(bot=bots[-1], **self.workflow_data)
|
||||
loggers.dispatcher.info("Start polling")
|
||||
try:
|
||||
tasks: List[asyncio.Task[Any]] = [
|
||||
|
|
@ -531,7 +526,7 @@ class Dispatcher(Router):
|
|||
polling_timeout=polling_timeout,
|
||||
backoff_config=backoff_config,
|
||||
allowed_updates=allowed_updates,
|
||||
**workflow_data,
|
||||
**self.workflow_data,
|
||||
)
|
||||
)
|
||||
for bot in bots
|
||||
|
|
@ -550,7 +545,7 @@ class Dispatcher(Router):
|
|||
finally:
|
||||
loggers.dispatcher.info("Polling stopped")
|
||||
try:
|
||||
await self.emit_shutdown(bot=bots[-1], **workflow_data)
|
||||
await self.emit_shutdown(bot=bots[-1], **self.workflow_data)
|
||||
finally:
|
||||
if close_bot_session:
|
||||
await asyncio.gather(*(bot.session.close() for bot in bots))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue