deleter: handle files (#24023)

pull/24020/head^2
Adeeb Shihadeh 2022-03-23 11:31:29 -07:00 committed by GitHub
parent 9f1c663ae2
commit 53909c1757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -28,6 +28,9 @@ def deleter_thread(exit_event):
try:
cloudlog.info(f"deleting {delete_path}")
if os.path.isfile(delete_path):
os.remove(delete_path)
else:
shutil.rmtree(delete_path)
break
except OSError: