Skip to content

Commit

Permalink
celery: Avoid using full day of week names in crontab
Browse files Browse the repository at this point in the history
This works fine in Celery, but is non-standard and breaks in current
djnago-celery-beat because it causes crash in cron-descriptor.

See celery/django-celery-beat#647 and
Salamek/cron-descriptor#65
  • Loading branch information
nijel committed Mar 27, 2023
1 parent 0899a74 commit 82f1370
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion weblate/accounts/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def setup_periodic_tasks(sender, **kwargs):
crontab(hour=1, minute=0), notify_daily.s(), name="notify-daily"
)
sender.add_periodic_task(
crontab(hour=2, minute=0, day_of_week="monday"),
crontab(hour=2, minute=0, day_of_week="mon"),
notify_weekly.s(),
name="notify-weekly",
)
Expand Down
6 changes: 3 additions & 3 deletions weblate/billing/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def setup_periodic_tasks(sender, **kwargs):
crontab(hour=0, minute=50), billing_alert.s(), name="billing-alert"
)
sender.add_periodic_task(
crontab(hour=3, minute=0, day_of_week="monday,thursday"),
crontab(hour=3, minute=0, day_of_week="mon,thu"),
billing_notify.s(),
name="billing-notify",
)
Expand All @@ -149,12 +149,12 @@ def setup_periodic_tasks(sender, **kwargs):
name="perform-removal",
)
sender.add_periodic_task(
crontab(hour=2, minute=0, day_of_week="monday,thursday"),
crontab(hour=2, minute=0, day_of_week="mon,thu"),
schedule_removal.s(),
name="schedule-removal",
)
sender.add_periodic_task(
crontab(hour=2, minute=30, day_of_week="monday,thursday"),
crontab(hour=2, minute=30, day_of_week="mon,thu"),
notify_expired.s(),
name="notify-expired",
)

0 comments on commit 82f1370

Please sign in to comment.