summaryrefslogtreecommitdiff
path: root/app/uploaders/object_storage.rb
diff options
context:
space:
mode:
authorMicaël Bergeron <mbergeron@gitlab.com>2018-06-07 11:06:04 -0400
committerMicaël Bergeron <mbergeron@gitlab.com>2018-06-07 12:06:00 -0400
commit50872bcc242a582c7e3af25df4d32e1c3e0a28f3 (patch)
tree73a2db2f25a2fe27dc4ffd343bcaebabfc0739bb /app/uploaders/object_storage.rb
parenta667de18d3b1d798992e1441ce774c63f801c07e (diff)
downloadgitlab-ce-50872bcc242a582c7e3af25df4d32e1c3e0a28f3.tar.gz
fix the failing spec
Diffstat (limited to 'app/uploaders/object_storage.rb')
-rw-r--r--app/uploaders/object_storage.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/uploaders/object_storage.rb b/app/uploaders/object_storage.rb
index bc8f1a5861a..bebaa3b807b 100644
--- a/app/uploaders/object_storage.rb
+++ b/app/uploaders/object_storage.rb
@@ -9,6 +9,7 @@ module ObjectStorage
RemoteStoreError = Class.new(StandardError)
UnknownStoreError = Class.new(StandardError)
ObjectStorageUnavailable = Class.new(StandardError)
+ ExclusiveLeaseTaken = Class.new(StandardError)
TMP_UPLOAD_PATH = 'tmp/uploads'.freeze
@@ -378,7 +379,7 @@ module ObjectStorage
def with_exclusive_lease
lease_key = exclusive_lease_key
uuid = Gitlab::ExclusiveLease.new(lease_key, timeout: 1.hour.to_i).try_obtain
- raise "Exclusive lease #{lease_key} already taken." unless uuid
+ raise ExclusiveLeaseTaken, "Exclusive lease #{lease_key} already taken." unless uuid
yield uuid
ensure