-
-
Save podolskyi/e2ae39f7409a787d223ea6d5d1e48b68 to your computer and use it in GitHub Desktop.
celery crontab example
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 | |
from flask.ext.celery import Celery | |
CELERYBEAT_SCHEDULE = { | |
# executes every night at 4:15 | |
'every-night': { | |
'task': 'user.checkaccounts', | |
'schedule': crontab(hour=4, minute=20) | |
} | |
} | |
celery = Celery(www) | |
@celery.task(name='user.checkaccounts') | |
def checkaccounts(): | |
# do something | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment