forked from CGM_Public/pretix_original
Auto-retry failed notifications
This commit is contained in:
@@ -257,7 +257,7 @@ def register_default_webhook_events(sender, **kwargs):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.task(base=TransactionAwareTask, acks_late=True)
|
@app.task(base=TransactionAwareTask, max_retries=9, default_retry_delay=900, acks_late=True)
|
||||||
def notify_webhooks(logentry_ids: list):
|
def notify_webhooks(logentry_ids: list):
|
||||||
if not isinstance(logentry_ids, list):
|
if not isinstance(logentry_ids, list):
|
||||||
logentry_ids = [logentry_ids]
|
logentry_ids = [logentry_ids]
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from pretix.celery_app import app
|
|||||||
from pretix.helpers.urls import build_absolute_uri
|
from pretix.helpers.urls import build_absolute_uri
|
||||||
|
|
||||||
|
|
||||||
@app.task(base=TransactionAwareTask, acks_late=True)
|
@app.task(base=TransactionAwareTask, acks_late=True, max_retries=9, default_retry_delay=900)
|
||||||
@scopes_disabled()
|
@scopes_disabled()
|
||||||
def notify(logentry_ids: list):
|
def notify(logentry_ids: list):
|
||||||
if not isinstance(logentry_ids, list):
|
if not isinstance(logentry_ids, list):
|
||||||
@@ -70,7 +70,7 @@ def notify(logentry_ids: list):
|
|||||||
send_notification.apply_async(args=(logentry.id, notification_type.action_type, user.pk, method))
|
send_notification.apply_async(args=(logentry.id, notification_type.action_type, user.pk, method))
|
||||||
|
|
||||||
|
|
||||||
@app.task(base=ProfiledTask, acks_late=True)
|
@app.task(base=ProfiledTask, acks_late=True, max_retries=9, default_retry_delay=900)
|
||||||
def send_notification(logentry_id: int, action_type: str, user_id: int, method: str):
|
def send_notification(logentry_id: int, action_type: str, user_id: int, method: str):
|
||||||
logentry = LogEntry.all.get(id=logentry_id)
|
logentry = LogEntry.all.get(id=logentry_id)
|
||||||
if logentry.event:
|
if logentry.event:
|
||||||
|
|||||||
Reference in New Issue
Block a user