Skip to content

Commit

Permalink
Minor code added to update task
Browse files Browse the repository at this point in the history
  • Loading branch information
P-T-I committed Apr 23, 2024
1 parent 57293e7 commit 64f2736
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions CveXplore/celery_app/cvexplore_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,6 @@ def crt_test(task_slug: str, *args, **kwargs) -> dict:


@app.task(
autoretry_for=(Exception,),
max_retries=5,
retry_backoff=True,
retry_backoff_max=700,
retry_jitter=True,
ignore_result=True,
task_time_limit=1800,
)
Expand All @@ -244,5 +239,9 @@ def crt_update(task_slug: str, *args, **kwargs) -> dict:

# Acquiring a lock to prevent this specific task to run twice or more at a time
with rh.acquire_lock(f"crt_update"):
cvex = CveXplore()
cvex.database.update()
try:
cvex = CveXplore()
cvex.database.update()
return {"status": task_status_codes.OK}
except Exception:
return {"status": task_status_codes.NOK}

0 comments on commit 64f2736

Please sign in to comment.