Skip to content

Commit 80d8306

Browse files
committed
fix: valid hours list
1 parent 4f777cb commit 80d8306

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

django_celery_beat/schedulers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,11 @@ def _get_crontab_exclude_query(self):
315315
hours_to_include += [4] # celery's default cleanup task
316316

317317
# Get all tasks with a simple numeric hour value
318-
# Create a list of all valid hour values (0-23), both padded and non-padded
319-
valid_hours = [str(hour) if hour >= 10 else f"{hour:02d}" for hour in range(24)]
318+
# Create a list of all valid hour values (0-23)
319+
# both padded and non-padded
320+
valid_hours = [str(hour) for hour in range(24)] + [
321+
f"{hour:02d}" for hour in range(10)
322+
]
320323
numeric_hour_tasks = CrontabSchedule.objects.filter(
321324
hour__in=valid_hours
322325
)

0 commit comments

Comments
 (0)