Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

added try/except block so that method handles errors more sanely #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 12 additions & 1 deletion modules/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,19 @@ def doCleanupDeletedFiles(cursor = None):
else:
if file["itercount"] > maxIterCount:
logging.info("Finally deleting, %s" % file["dlkey"])
blobstore.delete(file["dlkey"])

try:
blobstore.delete(file["dlkey"])

except blobstore.PermissionDeniedError:
logging.info("No permission to delete this file, ignoring")

except Exception as e:
# logging.exception(e)
raise e
Comment on lines +468 to +470
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason for this. Can you remove it?


db.Delete(file.key())

# There should be exactly 1 or 0 of these
for f in db.Query("file").filter("dlkey =", file["dlkey"]).iter(keysOnly=True):
db.Delete(f)
Expand Down