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.

Revisions

  1. channeng created this gist Oct 22, 2017.
    18 changes: 18 additions & 0 deletions celeryconfig.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    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="*"),
    }
    }