From 36901483a06d55ad725ede3041aabf07ef4d0de5 Mon Sep 17 00:00:00 2001 From: kshitijrajsharma Date: Fri, 22 Dec 2023 19:25:27 +0545 Subject: [PATCH] Ignore shutil error and added task finished info --- API/tasks.py | 1 + src/app.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/API/tasks.py b/API/tasks.py index a93b0dc6..ad3662d5 100644 --- a/API/tasks.py +++ b/API/tasks.py @@ -37,6 +37,7 @@ def get_task_status(task_id): "id": task_id, "status": task_result.state, "result": task_result.result if task_result.status == "SUCCESS" else None, + "finished_at": task_result.date_done if task_result.date_done else None, } return JSONResponse(result) diff --git a/src/app.py b/src/app.py index 85d81ce8..c0e27cd2 100644 --- a/src/app.py +++ b/src/app.py @@ -1195,7 +1195,7 @@ def __init__(self, params): self.iso3.upper() if self.iso3 else self.params.dataset.dataset_prefix, ) if os.path.exists(self.default_export_path): - shutil.rmtree(self.default_export_path) + shutil.rmtree(self.default_export_path, ignore_errors=True) os.makedirs(self.default_export_path) self.duck_db_db_path = os.path.join( self.default_export_path,