From 32992d889b28506073dc62ea701b7166b8fb04f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louisa=20v=2E=20H=C3=BClsen?= Date: Tue, 13 Feb 2024 11:34:47 +0100 Subject: [PATCH] ZO-4649: Configure max retry for speech webhook --- core/docs/changelog/ZO-4649.change | 1 + core/src/zeit/speech/json/webhook.py | 4 +++- core/src/zeit/speech/testing.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 core/docs/changelog/ZO-4649.change diff --git a/core/docs/changelog/ZO-4649.change b/core/docs/changelog/ZO-4649.change new file mode 100644 index 0000000000..578faf926e --- /dev/null +++ b/core/docs/changelog/ZO-4649.change @@ -0,0 +1 @@ +ZO-4649: Configure max retries for speech webhook celery task diff --git a/core/src/zeit/speech/json/webhook.py b/core/src/zeit/speech/json/webhook.py index 80ab1c6d01..7de00597e0 100644 --- a/core/src/zeit/speech/json/webhook.py +++ b/core/src/zeit/speech/json/webhook.py @@ -63,7 +63,9 @@ def SPEECH_WEBHOOK_TASK(self, payload: dict): speech.delete(payload) except zeit.cms.checkout.interfaces.CheckinCheckoutError: config = zope.app.appsetup.product.getProductConfiguration('zeit.speech') - self.retry(countdown=int(config['retry-delay-seconds'])) + self.retry( + countdown=int(config['retry-delay-seconds']), max_retries=int(config['max-retries']) + ) def validate_request(payload: dict): diff --git a/core/src/zeit/speech/testing.py b/core/src/zeit/speech/testing.py index ca4fee0e24..a7af262522 100644 --- a/core/src/zeit/speech/testing.py +++ b/core/src/zeit/speech/testing.py @@ -17,6 +17,7 @@ principal zope.speech speech-folder tts retry-delay-seconds 0 + max-retries 1 """