Skip to content

Commit 897e451

Browse files
committed
Updated label based schedule source.
Signed-off-by: Pavel Kirilin <[email protected]>
1 parent 6f5e816 commit 897e451

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

taskiq/schedule_sources/label_based.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def get_schedules(self) -> List["ScheduledTask"]:
2828
if task.broker != self.broker:
2929
continue
3030
for schedule in task.labels.get("schedule", []):
31-
if "cron" not in schedule:
31+
if "cron" not in schedule and "time" not in schedule:
3232
continue
3333
labels = schedule.get("labels", {})
3434
labels.update(task.labels)
@@ -38,7 +38,8 @@ async def get_schedules(self) -> List["ScheduledTask"]:
3838
labels=labels,
3939
args=schedule.get("args", []),
4040
kwargs=schedule.get("kwargs", {}),
41-
cron=schedule["cron"],
41+
cron=schedule.get("cron"),
42+
time=schedule.get("time"),
4243
),
4344
)
4445
return schedules

0 commit comments

Comments
 (0)