Ignore files already deleted on GCS file deletions

Relying on the GET request issued first to fetch the file we want to
delete is not enough to avoid this error. If the file is deleted after
our GET request but before the DELETE request we'll get a NotFound error
that after all means that the file is already deleted, so it can be
safely ignored.
上级 c2b2a8c7
......@@ -35,7 +35,11 @@ def download(key)
def delete(key)
instrument :delete, key do
file_for(key).try(:delete)
begin
file_for(key).try(:delete)
rescue Google::Cloud::NotFoundError
# Ignore files already deleted
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册