I need to call the following 2 apply_async tasks:
escalate.apply_async((e.id), countdown=3)
escalate.apply_async((e.id), countdown=3)
The implementation of my tasks is as follows:
@app.task
def escalate(id, group):
escalation_email, created = EscalationEmail.objects.get_or_create()
escalation_email.send()
return 'sup email sent'
I start work with the following command:
celery -A proj worker -l info --concurrency=10
The problem is that when I look at the worker, only 1 job is accepted, and only 1 succeeds. In addition, only 1 email address is sent.
Most of the time, it seems, the second escalation of the task is performed.
How can I guarantee that these tasks promise 100% reliability?
source
share