Skip to content

Commit

Permalink
Merge branch 'release/0.11.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius committed Apr 26, 2024
2 parents b352cb4 + a35b086 commit 52b1670
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/framework_integrations/taskiq-with-aiogram.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
maintainers = ["Pavel Kirilin <[email protected]>"]
Expand Down
7 changes: 3 additions & 4 deletions taskiq/cli/scheduler/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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())

Expand Down

0 comments on commit 52b1670

Please sign in to comment.