Slide 39
Slide 39 text
from celery.schedules import crontab
SCHEDULE = {
'run_task': {
# use the actual path
'task': 'path.to.task',
# every 5 minutes
'schedule': crontab(minute='*/5'),
# args and kwargs
'args': [],
'kwargs': {'device_id': d.pk},
} for d in Device.objects.all()
}
schedule.py
static arguments only
code is only evaluated once at run time,
better to have one task spawn daughters
(when)