mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
parent
a890622e40
commit
484a61bdc1
3 changed files with 6 additions and 6 deletions
1
CHANGES/1196.bugfix.rst
Normal file
1
CHANGES/1196.bugfix.rst
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fixed workflow data propagation
|
||||
|
|
@ -500,11 +500,10 @@ class Dispatcher(Router):
|
|||
workflow_data = {
|
||||
"dispatcher": self,
|
||||
"bots": bots,
|
||||
"bot": bots[-1],
|
||||
**kwargs,
|
||||
**self.workflow_data,
|
||||
**kwargs,
|
||||
}
|
||||
await self.emit_startup(**workflow_data)
|
||||
await self.emit_startup(bot=bots[-1], **workflow_data)
|
||||
loggers.dispatcher.info("Start polling")
|
||||
try:
|
||||
tasks: List[asyncio.Task[Any]] = [
|
||||
|
|
@ -515,7 +514,7 @@ class Dispatcher(Router):
|
|||
polling_timeout=polling_timeout,
|
||||
backoff_config=backoff_config,
|
||||
allowed_updates=allowed_updates,
|
||||
**kwargs,
|
||||
**workflow_data,
|
||||
)
|
||||
)
|
||||
for bot in bots
|
||||
|
|
@ -534,7 +533,7 @@ class Dispatcher(Router):
|
|||
finally:
|
||||
loggers.dispatcher.info("Polling stopped")
|
||||
try:
|
||||
await self.emit_shutdown(**workflow_data)
|
||||
await self.emit_shutdown(bot=bots[-1], **workflow_data)
|
||||
finally:
|
||||
if close_bot_session:
|
||||
await asyncio.gather(*(bot.session.close() for bot in bots))
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ def setup_application(app: Application, dispatcher: Dispatcher, /, **kwargs: Any
|
|||
workflow_data = {
|
||||
"app": app,
|
||||
"dispatcher": dispatcher,
|
||||
**kwargs,
|
||||
**dispatcher.workflow_data,
|
||||
**kwargs,
|
||||
}
|
||||
|
||||
async def on_startup(*a: Any, **kw: Any) -> None: # pragma: no cover
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue