You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ListRedisScheduleSource do not support schedule_by_interval - schedules are stored but never executed #115
When using ListRedisScheduleSource with schedule_by_interval(), the schedule data is stored in Redis (schedule:data:{id}) but the schedule is never executed because it's not added to any index list.
Root Cause
In ListRedisScheduleSource.add_schedule(), only cron and time schedules are indexed:
asyncdefadd_schedule(self, schedule: "ScheduledTask") ->None:
asyncwithRedis(connection_pool=self._connection_pool) asredis:
awaitredis.set(
f"{self._prefix}:data:{schedule.schedule_id}",
self._serializer.dumpb(model_dump(schedule)),
)
ifschedule.cronisnotNone:
awaitredis.rpush(self._get_cron_key(), schedule.schedule_id)
elifschedule.timeisnotNone:
awaitredis.rpush(self._get_time_key(schedule.time), schedule.schedule_id)
# ⚠️ schedule.interval is NOT handled - data is saved but never indexed
Similarly, get_schedules() only retrieves schedules from schedule:cron and schedule:time:{datetime} lists.
Steps to Reproduce
fromdatetimeimporttimedeltafromtaskiq_redisimportListRedisScheduleSourcesource=ListRedisScheduleSource(url="redis://localhost:6379/0")
@broker.taskasyncdefmy_task():
pass# This creates schedule:data:{id} but NOT schedule:interval or similarschedule=awaitmy_task.schedule_by_interval(
source=source,
interval=timedelta(seconds=300),
)
# Returns empty list - schedule is lostschedules=awaitsource.get_schedules() # []
Expected Behavior
schedule_by_interval should work with ListRedisScheduleSource, either by:
Adding support for interval schedules (e.g., schedule:interval list)
Workaround
Use schedule_by_cron() instead of schedule_by_interval():
Activity
s3rius commentedon Dec 19, 2025
That is a quite critical problem. Okay, will update tomorrow.
s3rius commentedon Dec 19, 2025
Fixed in #117.
s3rius commentedon Dec 19, 2025
I'm closing the issue. In case of regression, please feel free to reopen.
BriceMichalski commentedon Dec 19, 2025
It works perfectly. Many thanks