From 5c98395620386221f7be7c47e309a9018ebd8d4c Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sat, 22 Sep 2018 23:57:00 +0300 Subject: [PATCH] Fast-mode in executor --- aiogram/utils/executor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aiogram/utils/executor.py b/aiogram/utils/executor.py index ac1a9657..f8611a26 100644 --- a/aiogram/utils/executor.py +++ b/aiogram/utils/executor.py @@ -20,7 +20,7 @@ def _setup_callbacks(executor, on_startup=None, on_shutdown=None): def start_polling(dispatcher, *, loop=None, skip_updates=False, reset_webhook=True, - on_startup=None, on_shutdown=None, timeout=None): + on_startup=None, on_shutdown=None, timeout=None, fast=True): """ Start bot in long-polling mode @@ -35,7 +35,7 @@ def start_polling(dispatcher, *, loop=None, skip_updates=False, reset_webhook=Tr executor = Executor(dispatcher, skip_updates=skip_updates, loop=loop) _setup_callbacks(executor, on_startup, on_shutdown) - executor.start_polling(reset_webhook=reset_webhook, timeout=timeout) + executor.start_polling(reset_webhook=reset_webhook, timeout=timeout, fast=fast) def start_webhook(dispatcher, webhook_path, *, loop=None, skip_updates=None, @@ -234,7 +234,7 @@ class Executor: web.run_app(self._web_app, **kwargs) - def start_polling(self, reset_webhook=None, timeout=None): + def start_polling(self, reset_webhook=None, timeout=None, fast=True): """ Start bot in long-polling mode @@ -246,7 +246,7 @@ class Executor: try: loop.run_until_complete(self._startup_polling()) - loop.create_task(self.dispatcher.start_polling(reset_webhook=reset_webhook, timeout=timeout)) + loop.create_task(self.dispatcher.start_polling(reset_webhook=reset_webhook, timeout=timeout, fast=fast)) loop.run_forever() except (KeyboardInterrupt, SystemExit): # loop.stop()