diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-28 21:14:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-28 21:14:18 +0300 |
commit | b267f3a3acf3fe4cf2a9bb254d7abeb3b2823b21 (patch) | |
tree | a1c30c9a460a1c990311d47aae72d00368e1a1c1 /app/models/uploads | |
parent | 03cd4f8da4f848c7dfd0c0b88b4c095f69e56bb0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/uploads')
-rw-r--r-- | app/models/uploads/fog.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/models/uploads/fog.rb b/app/models/uploads/fog.rb index b44e273e9ab..5d57b644dbe 100644 --- a/app/models/uploads/fog.rb +++ b/app/models/uploads/fog.rb @@ -15,13 +15,21 @@ module Uploads end def delete_keys(keys) - keys.each do |key| - connection.delete_object(bucket_name, key) - end + keys.each { |key| delete_object(key) } end private + def delete_object(key) + connection.delete_object(bucket_name, key) + + # So far, only GoogleCloudStorage raises an exception when the file is not found. + # Other providers support idempotent requests and does not raise an error + # when the file is missing. + rescue ::Google::Apis::ClientError => e + Gitlab::ErrorTracking.log_exception(e) + end + def object_store Gitlab.config.uploads.object_store end |