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

Commit

Permalink
fix: util: clear_tmp_folder: exclude invalid symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
kac- committed May 30, 2023
1 parent bd9f9bc commit 5582d14
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ def clear_tmp_folder(path, size):
all_files = ""
for (path, dirs, files) in os.walk(path):
all_files = [os.path.join(path, file) for file in files]
# exclude invalid symlinks (linux)
all_files = [file for file in all_files if os.path.exists(file)]
all_files.sort(key=lambda x: os.path.getmtime(x))
size_tp = 0
for idx, file in enumerate(all_files):
Expand Down

0 comments on commit 5582d14

Please sign in to comment.