Skip to content

Commit f6962ac

Browse files
auvipyCopilot
andauthored
Update django_celery_beat/schedulers.py
Co-authored-by: Copilot <[email protected]>
1 parent 80d8306 commit f6962ac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

django_celery_beat/schedulers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +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)
318+
# Create a list of all valid hour values (0-23).
319+
# Both zero-padded ("00"–"09") and non-padded ("0"–"23") formats are included
320+
# to account for variations in how hour values are stored in the database.
321+
# Some databases or configurations may store single-digit hours without padding,
322+
# while others may use zero-padded strings. Including both ensures compatibility.
319323
# both padded and non-padded
320324
valid_hours = [str(hour) for hour in range(24)] + [
321325
f"{hour:02d}" for hour in range(10)

0 commit comments

Comments
 (0)