Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check tasks will be automatically picked up in case of outage #11

Open
filipeximenes opened this issue Aug 21, 2017 · 0 comments
Open

Comments

@filipeximenes
Copy link
Contributor

In case of outage make sure Celery will pick up the tasks that were supposed to run while the system was off (if this makes sense in your business logic).

Bad:

# Messages for some tasks won't be sent if the outage lasts one day
for task in Tasks.objects.filter(due_to=today):
    send_messages()

Better:

for task in Tasks.objects.filter(due_to__lte=today, sent=False):
   send_messages()
@filipeximenes filipeximenes changed the title Check tasks Check tasks will be automatically picked up in case of outage Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant