Skip to content

Commit e515583

Browse files
committed
Updated API method.
1 parent 47d1fbd commit e515583

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

taskiq/api/scheduler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
from datetime import timedelta
2+
from typing import Optional
3+
14
from taskiq.cli.scheduler.run import run_scheduler_loop
25
from taskiq.scheduler.scheduler import TaskiqScheduler
36

47

58
async def run_scheduler_task(
69
scheduler: TaskiqScheduler,
710
run_startup: bool = False,
11+
interval: Optional[timedelta] = None,
812
) -> None:
913
"""
1014
Run scheduler task.
@@ -20,4 +24,4 @@ async def run_scheduler_task(
2024
if run_startup:
2125
await scheduler.startup()
2226
while True:
23-
await run_scheduler_loop(scheduler)
27+
await run_scheduler_loop(scheduler, interval)

taskiq/cli/scheduler/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ async def run_scheduler_loop( # noqa: C901
154154
and runs tasks when needed.
155155
156156
:param scheduler: current scheduler.
157+
:param interval: interval to check for schedule updates.
157158
"""
158159
loop = asyncio.get_event_loop()
159160
running_schedules: Dict[str, asyncio.Task[Any]] = {}

0 commit comments

Comments
 (0)