From a6b6cb77879272271df39c0390181100446d3e07 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Sat, 30 Nov 2024 00:31:40 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(summary)=20make=20celery=20max=20r?= =?UTF-8?q?etries=20an=20env=20configurations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Minor tweak ! It would be useful when we'll scale or microservice. --- src/summary/summary/core/celery_worker.py | 2 +- src/summary/summary/core/config.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/summary/summary/core/celery_worker.py b/src/summary/summary/core/celery_worker.py index 1652e0e0..f43709cc 100644 --- a/src/summary/summary/core/celery_worker.py +++ b/src/summary/summary/core/celery_worker.py @@ -59,7 +59,7 @@ def post_with_retries(url, data): session.close() -@celery.task(max_retries=1) +@celery.task(max_retries=settings.celery_max_retries) def process_audio_transcribe_summarize(filename: str, email: str, sub: str): """Process an audio file by transcribing it and generating a summary. diff --git a/src/summary/summary/core/config.py b/src/summary/summary/core/config.py index bc88bd07..c9a50790 100644 --- a/src/summary/summary/core/config.py +++ b/src/summary/summary/core/config.py @@ -19,6 +19,7 @@ class Settings(BaseSettings): # Celery settings celery_broker_url: str = "redis://redis/0" celery_result_backend: str = "redis://redis/0" + celery_max_retries: int = 1 # Minio settings aws_storage_bucket_name: str