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

@@ -13,7 +13,7 @@ from pretix.celery_app import app
from pretix.helpers.urls import build_absolute_uri
@app.task(base=TransactionAwareTask)
@app.task(base=TransactionAwareTask, acks_late=True)
@scopes_disabled()
def notify(logentry_id: int):
logentry = LogEntry.all.select_related('event', 'event__organizer').get(id=logentry_id)
@@ -66,7 +66,7 @@ def notify(logentry_id: int):
send_notification.apply_async(args=(logentry_id, notification_type.action_type, user.pk, method))
@app.task(base=ProfiledTask)
@app.task(base=ProfiledTask, acks_late=True)
def send_notification(logentry_id: int, action_type: str, user_id: int, method: str):
logentry = LogEntry.all.get(id=logentry_id)
if logentry.event: