diff --git a/lib/gitlab/exclusive_lease_helpers.rb b/lib/gitlab/exclusive_lease_helpers.rb index ab6838adc6d3c902ae36d2129a5b48cded576551..e998548cff9c65d67b91fb61d0637051abd59194 100644 --- a/lib/gitlab/exclusive_lease_helpers.rb +++ b/lib/gitlab/exclusive_lease_helpers.rb @@ -21,7 +21,7 @@ module Gitlab raise FailedToObtainLockError, 'Failed to obtain a lock' unless uuid - return yield + yield ensure Gitlab::ExclusiveLease.cancel(key, uuid) end