diff --git a/docs/framework_integrations/taskiq-with-aiogram.md b/docs/framework_integrations/taskiq-with-aiogram.md index 3a4e684..d10682d 100644 --- a/docs/framework_integrations/taskiq-with-aiogram.md +++ b/docs/framework_integrations/taskiq-with-aiogram.md @@ -67,7 +67,7 @@ bot = Bot(token="TOKEN") @dp.startup() async def setup_taskiq(bot: Bot, *_args, **_kwargs): # Here we check if it's a clien-side, - # Becuase otherwise you're going to + # Because otherwise you're going to # create infinite loop of startup events. if not broker.is_worker_process: logging.info("Setting up taskiq") diff --git a/pyproject.toml b/pyproject.toml index c76c7a0..ce4ad02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "taskiq" -version = "0.11.1" +version = "0.11.2" description = "Distributed task queue with full async support" authors = ["Pavel Kirilin "] maintainers = ["Pavel Kirilin "] diff --git a/taskiq/cli/scheduler/run.py b/taskiq/cli/scheduler/run.py index 6a17a11..be4bdd1 100644 --- a/taskiq/cli/scheduler/run.py +++ b/taskiq/cli/scheduler/run.py @@ -144,9 +144,6 @@ async def run_scheduler_loop(scheduler: TaskiqScheduler) -> None: running_schedules = set() while True: # We use this method to correctly sleep for one minute. - next_minute = datetime.now().replace(second=0, microsecond=0) + timedelta( - minutes=1, - ) scheduled_tasks = await get_all_schedules(scheduler) for source, task_list in scheduled_tasks.items(): for task in task_list: @@ -165,7 +162,9 @@ async def run_scheduler_loop(scheduler: TaskiqScheduler) -> None: ) running_schedules.add(send_task) send_task.add_done_callback(running_schedules.discard) - + next_minute = datetime.now().replace(second=0, microsecond=0) + timedelta( + minutes=1, + ) delay = next_minute - datetime.now() await asyncio.sleep(delay.total_seconds())