mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
fix(celery_app.py): add retries to worker
This commit is contained in:
parent
381fdcd37b
commit
e5fa4eb314
1 changed files with 1 additions and 2 deletions
|
@ -42,7 +42,7 @@ celery_app.conf.update(
|
|||
|
||||
|
||||
# Celery task
|
||||
@celery_app.task(name='process_job')
|
||||
@celery_app.task(name='process_job', max_retries=3)
|
||||
def process_job(*args, **kwargs):
|
||||
try:
|
||||
llm_router: litellm.Router = litellm.Router(model_list=kwargs.pop("llm_model_list"))
|
||||
|
@ -52,7 +52,6 @@ def process_job(*args, **kwargs):
|
|||
return json.loads(response)
|
||||
return str(response)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
raise e
|
||||
|
||||
# Ensure Celery workers are terminated when the script exits
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue