Last active
April 23, 2020 15:33
-
-
Save sikaili99/bc2abc274ddf670028f11dd1688815ca to your computer and use it in GitHub Desktop.
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_BROKER_URL = 'redis://localhost:6379' #You can also refrence a remote url from e.g heroku | |
CELERY_TIMEZONE = 'Europe/Warsaw' | |
HOUR = 0 | |
DAY = 0 | |
# Let's make things happen | |
CELERY_BEAT_SCHEDULE = { | |
'send-sms-every-hour': { | |
'task': 'send-sms', | |
# There are 4 ways we can handle time, read further | |
'schedule': 3600.0, | |
# If you're using any arguments | |
'args': ('We don't need any',), | |
}, | |
# Executes every Friday at 6am | |
'send-notification-on-friday-afternoon': { | |
'task': 'my_app.tasks.send_notification', | |
'schedule': crontab(hour=HOUR, day_of_week=DAY), | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment