2010-12-09 11 views

Respuesta

1

Puede hacer esto utilizando Crontab schedules y cand definir este sea:

  • en su Django settings.py :
from celery.schedules import crontab 

CELERYBEAT_SCHEDULE = { 
    'my_periodic_task': { 
     'task': 'my_app.tasks.my_periodic_task', 
     'schedule': crontab(0, 0, day_of_month='1'), # Execute on the first day of every month. 
    }, 
} 
  • en celery.py config:
from celery import Celery 
from celery.schedules import crontab 

app = Celery('app_name') 
app.conf.beat_schedule = { 
    'my_periodic_task': { 
     'task': 'my_app.tasks.my_periodic_task', 
     'schedule': crontab(0, 0, day_of_month='1'), # Execute on the first day of every month. 
    }, 
} 
Cuestiones relacionadas