Skip to content

Reopened from #806: Celery task does not run when crontab day of week is set to 7 #892

@lyla0427

Description

@lyla0427

reopened from #806

Summary:

Celery task does not run when crontab day of week is set to 7.

  • Celery Version: 5.4.0
  • Celery-Beat Version: 2.6.0

Exact steps to reproduce the issue:

  1. Register a task that runs at any desired time on Sunday.
  2. Crontab's day of week should be set to 7.
  3. Celery task doesn't run.

Detailed information

django_celery_beat/models.py

  • The help_text of day_of_week in the CrontabSchedule model says 'Cron Days Of The Week to Run. Use "*" for "all", Sunday '
    'is 0 or 7, Monday is 1. (Example: "0,5")').
    Screenshot 2024-09-20 at 5 49 12 PM

celery/schedules.py

  • However, description presented in Celery module indicates 0 is translated to Sunday.
    Screenshot 2024-09-20 at 6 03 23 PM
  • In the remaining_delta function as well, Sunday is calculated as 0, not 7
    Screenshot 2024-09-20 at 6 06 50 PM

The comments in django_celery_beat should be modified to reflect this information, or the source code should be modified to ensure the task is sent on Sunday even when the crontab is set to 7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions