Set acks_late=True on celery tasks where we would prefer double execution over failure

This commit is contained in:
Raphael Michel
2020-05-19 16:32:45 +02:00
parent 059bdc629e
commit 5dd5ff8a7c
7 changed files with 12 additions and 8 deletions

View File

@@ -168,7 +168,7 @@ def register_default_webhook_events(sender, **kwargs):
)
@app.task(base=TransactionAwareTask)
@app.task(base=TransactionAwareTask, acks_late=True)
def notify_webhooks(logentry_id: int):
logentry = LogEntry.all.select_related('event', 'event__organizer').get(id=logentry_id)
@@ -205,7 +205,7 @@ def notify_webhooks(logentry_id: int):
send_webhook.apply_async(args=(logentry_id, notification_type.action_type, wh.pk))
@app.task(base=ProfiledTask, bind=True, max_retries=9)
@app.task(base=ProfiledTask, bind=True, max_retries=9, acks_late=True)
def send_webhook(self, logentry_id: int, action_type: str, webhook_id: int):
# 9 retries with 2**(2*x) timing is roughly 72 hours
with scopes_disabled():