Webhooks: Fix retry logic (Z#23197527) (#5250)

* Webhooks: Fix retry logic (Z#23197527)

* Add no-op migration
This commit is contained in:
Raphael Michel
2025-06-25 08:56:46 +02:00
committed by GitHub
parent 5d3fc62ba4
commit 9017128513
3 changed files with 27 additions and 4 deletions

View File

@@ -527,8 +527,10 @@ def send_webhook(self, logentry_id: int, action_type: str, webhook_id: int, retr
if retry_count >= len(retry_intervals):
return 'retry-given-up'
elif retry_intervals[retry_count] < retry_celery_cutoff:
send_webhook.apply_async(args=(logentry_id, action_type, webhook_id, retry_count + 1),
countdown=retry_intervals[retry_count])
send_webhook.apply_async(
args=(logentry_id, action_type, webhook_id, retry_count + 1),
countdown=retry_intervals[retry_count]
)
return 'retry-via-celery'
else:
webhook.retries.update_or_create(
@@ -555,7 +557,10 @@ def send_webhook(self, logentry_id: int, action_type: str, webhook_id: int, retr
if retry_count >= len(retry_intervals):
return 'retry-given-up'
elif retry_intervals[retry_count] < retry_celery_cutoff:
send_webhook.apply_async(args=(logentry_id, action_type, webhook_id, retry_count + 1))
send_webhook.apply_async(
args=(logentry_id, action_type, webhook_id, retry_count + 1),
countdown=retry_intervals[retry_count]
)
return 'retry-via-celery'
else:
webhook.retries.update_or_create(