diff --git a/api/tasks/ops_trace_task.py b/api/tasks/ops_trace_task.py index b3963a7be4..34c62dc923 100644 --- a/api/tasks/ops_trace_task.py +++ b/api/tasks/ops_trace_task.py @@ -45,9 +45,10 @@ def process_trace_tasks(file_info): if trace_type: trace_info = trace_type(**trace_info) trace_instance.trace(trace_info) - storage.delete(file_path) logging.info(f"Processing trace tasks success, app_id: {app_id}") except Exception: failed_key = f"{OPS_TRACE_FAILED_KEY}_{app_id}" redis_client.incr(failed_key) logging.info(f"Processing trace tasks failed, app_id: {app_id}") + finally: + storage.delete(file_path)