feat: add delete file finally

This commit is contained in:
Joe 2024-11-08 14:16:02 +08:00
parent 532dfd6ae8
commit 36cf784c9c

View File

@ -45,9 +45,10 @@ def process_trace_tasks(file_info):
if trace_type: if trace_type:
trace_info = trace_type(**trace_info) trace_info = trace_type(**trace_info)
trace_instance.trace(trace_info) trace_instance.trace(trace_info)
storage.delete(file_path)
logging.info(f"Processing trace tasks success, app_id: {app_id}") logging.info(f"Processing trace tasks success, app_id: {app_id}")
except Exception: except Exception:
failed_key = f"{OPS_TRACE_FAILED_KEY}_{app_id}" failed_key = f"{OPS_TRACE_FAILED_KEY}_{app_id}"
redis_client.incr(failed_key) redis_client.incr(failed_key)
logging.info(f"Processing trace tasks failed, app_id: {app_id}") logging.info(f"Processing trace tasks failed, app_id: {app_id}")
finally:
storage.delete(file_path)