deleter: handle files (#24023)

This commit is contained in:
Adeeb Shihadeh
2022-03-23 11:31:29 -07:00
committed by GitHub
parent 9f1c663ae2
commit 53909c1757
+4 -1
View File
@@ -28,7 +28,10 @@ def deleter_thread(exit_event):
try:
cloudlog.info(f"deleting {delete_path}")
shutil.rmtree(delete_path)
if os.path.isfile(delete_path):
os.remove(delete_path)
else:
shutil.rmtree(delete_path)
break
except OSError:
cloudlog.exception(f"issue deleting {delete_path}")