Skip to content

Commit 4f777cb

Browse files
auvipyCopilot
andauthored
Update django_celery_beat/schedulers.py
Co-authored-by: Copilot <[email protected]>
1 parent 792d3aa commit 4f777cb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

django_celery_beat/schedulers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,8 @@ 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)
319-
valid_hours = [str(hour) for hour in range(24)] + [
320-
f"{hour:02d}" for hour in range(10)
321-
]
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)]
322320
numeric_hour_tasks = CrontabSchedule.objects.filter(
323321
hour__in=valid_hours
324322
)

0 commit comments

Comments
 (0)