From 0e224c1667c7dcc8762bf17823579c9bde0fdf4c Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 7 Sep 2024 17:51:14 +0200 Subject: [PATCH] On ajuste la gestion des exceptions --- src/agenda_culturel/celery.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/agenda_culturel/celery.py b/src/agenda_culturel/celery.py index 05b888a..3189670 100644 --- a/src/agenda_culturel/celery.py +++ b/src/agenda_culturel/celery.py @@ -212,8 +212,14 @@ def run_recurrent_import(self, pk): else: return run_recurrent_import_internal(rimport, downloader, self.request.id) - # if chromium is locked, we wait 30 seconds before retrying - raise self.retry(countdown=30) + try: + # if chromium is locked, we wait before retrying + raise self.retry(countdown=120) + except celery.exceptions.MaxRetriesExceededError as e: + logger.error(e) + close_import_task(req_id, False, e, importer) + +