Skip to content

Instantly share code, notes, and snippets.

@channeng
Created October 22, 2017 16:21
Show Gist options
  • Select an option

  • Save channeng/f105997e57e9f067fbea7a048789099e to your computer and use it in GitHub Desktop.

Select an option

Save channeng/f105997e57e9f067fbea7a048789099e to your computer and use it in GitHub Desktop.
Celery Flask setup - celeryconfig and celerybeat schedule
from celery.schedules import crontab
CELERY_IMPORTS = ('app.tasks.test')
CELERY_TASK_RESULT_EXPIRES = 30
CELERY_TIMEZONE = 'UTC'
CELERY_ACCEPT_CONTENT = ['json', 'msgpack', 'yaml']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERYBEAT_SCHEDULE = {
'test-celery': {
'task': 'app.tasks.test.print_hello',
# Every minute
'schedule': crontab(minute="*"),
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment