Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt at fix dungbeetle alert #213

Merged
merged 2 commits into from
Mar 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions dragonfly/implementations/dungbeetle.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ def clean_file(self, path, min_creation_time):

# recursively delete empty directories
def del_dir(self, path, min_creation_time, processed_dirs_per_cycle, new_dirs):
if not os.path.isdir(path):
if ".nfs" in path or os.path.getsize(path) == 0:
self.clean_file(path, min_creation_time)
if os.path.isfile(path):
try:
if ".nfs" in path or os.path.getsize(path) == 0:
self.clean_file(path, min_creation_time)
except OSError:
if os.path.exists(path):
logger.warning("file [{}] has not been removed.".format(path))
elif os.path.isdir(path):
creation_time = datetime.datetime.fromtimestamp(os.path.getctime(path))
no_sub_dir = True
Expand Down