Skip to content

Added second-based scheduler intervals. #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 19, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated API method.
  • Loading branch information
s3rius committed Apr 19, 2025
commit e51558378745ca9dd25be325d0123796bb79adac
6 changes: 5 additions & 1 deletion taskiq/api/scheduler.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from datetime import timedelta
from typing import Optional

from taskiq.cli.scheduler.run import run_scheduler_loop
from taskiq.scheduler.scheduler import TaskiqScheduler


async def run_scheduler_task(
scheduler: TaskiqScheduler,
run_startup: bool = False,
interval: Optional[timedelta] = None,
) -> None:
"""
Run scheduler task.
Expand All @@ -20,4 +24,4 @@ async def run_scheduler_task(
if run_startup:
await scheduler.startup()
while True:
await run_scheduler_loop(scheduler)
await run_scheduler_loop(scheduler, interval)
1 change: 1 addition & 0 deletions taskiq/cli/scheduler/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ async def run_scheduler_loop( # noqa: C901
and runs tasks when needed.

:param scheduler: current scheduler.
:param interval: interval to check for schedule updates.
"""
loop = asyncio.get_event_loop()
running_schedules: Dict[str, asyncio.Task[Any]] = {}
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy