Skip to content
Snippets Groups Projects
Commit 704447e1 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Minor fix.

parent c957a5b1
No related branches found
No related tags found
No related merge requests found
Pipeline #8906 passed
...@@ -74,6 +74,7 @@ class FileCleaner(object): ...@@ -74,6 +74,7 @@ class FileCleaner(object):
nodeId = row["node_id"] nodeId = row["node_id"]
delta = cTime - dTime delta = cTime - dTime
if delta.days >= self.days and delta.seconds > self.seconds: if delta.days >= self.days and delta.seconds > self.seconds:
if os.path.exists(filePath):
os.remove(filePath) os.remove(filePath)
self.logger.debug(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + filePath) self.logger.debug(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + filePath)
try: try:
...@@ -81,7 +82,7 @@ class FileCleaner(object): ...@@ -81,7 +82,7 @@ class FileCleaner(object):
except Exception: except Exception:
self.logger.exception(f"FATAL: unable to set the 'phy_deleted_on' flag for VOSpace node having ID = {nodeId}") self.logger.exception(f"FATAL: unable to set the 'phy_deleted_on' flag for VOSpace node having ID = {nodeId}")
return return
if basePath not in basePaths: if os.path.exists(basePath) and basePath not in basePaths:
basePaths.append(basePath) basePaths.append(basePath)
self.logger.info("Removing empty folders (if any)...") self.logger.info("Removing empty folders (if any)...")
for basePath in basePaths: for basePath in basePaths:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment