run cron task in the morning
This commit is contained in:
parent
bf62056bb2
commit
910b8426dc
3 changed files with 6 additions and 2 deletions
|
|
@ -3,11 +3,12 @@
|
|||
from datetime import timedelta
|
||||
|
||||
from celery.decorators import task, periodic_task
|
||||
from celery.task.schedules import crontab
|
||||
|
||||
import models
|
||||
|
||||
|
||||
@periodic_task(run_every=timedelta(days=1), queue='encoding')
|
||||
@periodic_task(run_every=crontab(hour=6, minute=30), queue='encoding')
|
||||
def update_all_matches(**kwargs):
|
||||
ids = [p['id'] for p in models.Place.objects.all().values('id')]
|
||||
for i in ids:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue