deleter: handle files (#24023)

old-commit-hash: 53909c175756fb0ea8e374ca01a41ecfb3d23466
This commit is contained in:
Adeeb Shihadeh
2022-03-23 11:31:29 -07:00
committed by GitHub
parent c6f626d116
commit e195b7de1e
+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}")