Skip to content

Commit

Permalink
Merge pull request #617 from ZeitOnline/ZO-4649_max_retries
Browse files Browse the repository at this point in the history
ZO-4649: Configure max retry for speech webhook
  • Loading branch information
louika committed Feb 13, 2024
2 parents 0d82aeb + 32992d8 commit e543961
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/docs/changelog/ZO-4649.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ZO-4649: Configure max retries for speech webhook celery task
4 changes: 3 additions & 1 deletion core/src/zeit/speech/json/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions core/src/zeit/speech/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
principal zope.speech
speech-folder tts
retry-delay-seconds 0
max-retries 1
</product-config>
"""

Expand Down

0 comments on commit e543961

Please sign in to comment.