mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 09:22:03 +00:00
Executor // Get loop from dispatcher
This commit is contained in:
parent
1ab9c09a5c
commit
99d11430cb
1 changed files with 2 additions and 2 deletions
|
|
@ -45,7 +45,7 @@ async def _wh_shutdown(app):
|
|||
def start_pooling(dispatcher, *, loop=None, skip_updates=False, on_startup=None, on_shutdown=None):
|
||||
log.warning('Start bot with long-pooling.')
|
||||
if loop is None:
|
||||
loop = asyncio.get_event_loop()
|
||||
loop = dispatcher.loop
|
||||
|
||||
loop.set_task_factory(context.task_factory)
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ def start_webhook(dispatcher, webhook_path, *, loop=None, skip_updates=None, on_
|
|||
**kwargs):
|
||||
log.warning('Start bot with webhook.')
|
||||
if loop is None:
|
||||
loop = asyncio.get_event_loop()
|
||||
loop = dispatcher.loop
|
||||
|
||||
loop.set_task_factory(context.task_factory)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue