Created
October 22, 2017 16:21
-
-
Save channeng/f105997e57e9f067fbea7a048789099e to your computer and use it in GitHub Desktop.
Celery Flask setup - celeryconfig and celerybeat schedule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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