Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
leeyoshinari committed Jul 15, 2023
2 parents 2cff930 + 60b2a1a commit f30f114
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions performance/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@
def delete_file_from_disk(file_path):
path_list = file_path.split('/')
if settings.FILE_STORE_TYPE == '0':
file_folder = os.path.join(settings.FILE_ROOT_PATH, path_list[-2])
file_local_path = os.path.join(file_folder, path_list[-1])
os.remove(file_local_path)
_ = delete_local_file(file_folder)
try:
file_folder = os.path.join(settings.FILE_ROOT_PATH, path_list[-2])
file_local_path = os.path.join(file_folder, path_list[-1])
os.remove(file_local_path)
_ = delete_local_file(file_folder)
except FileNotFoundError:
logger.warning(f"FileNotFound: No such file: {file_path}")
else:
settings.MINIO_CLIENT.delete_file(path_list[-2], path_list[-1])

Expand Down

0 comments on commit f30f114

Please sign in to comment.