Reputation: 135
I have some schedule problem in Celery. The task works, however I want it to run once on Monday, but it runs every minute. My schedule config:
CELERY_BEAT_SCHEDULE = {
'kek': {
'task': 'kek',
'schedule': crontab(day_of_week=1),
}
}
Upvotes: 0
Views: 131
Reputation: 960
Welcome to SO, @Sturm.
Just define hour and minute:
# Executes every Monday morning at 8:30 a.m.
crontab(hour=8, minute=30, day_of_week=1)#Monday is 1
This is happening because the default for crontab is to execute the task every minute.
For further information, just check the documentation for crontab.
Upvotes: 1