diff options
| author | Patrick Bajao <ebajao@gitlab.com> | 2019-03-18 14:56:52 +0800 |
|---|---|---|
| committer | Patrick Bajao <ebajao@gitlab.com> | 2019-03-19 12:06:57 +0800 |
| commit | 6d097a6c56792fdfb4e89a58b231f86de30289f7 (patch) | |
| tree | c7b00f9404a11d1d2ec8e98271703965fc9b9f8b | |
| parent | cd8eaa96f656ebe24995a2f05486f1a2912b48f4 (diff) | |
| download | gitlab-ce-56089-merge-gitlab-keys.tar.gz | |
Fix static analysis failure56089-merge-gitlab-keys
No need for a `begin` within a block.
| -rw-r--r-- | lib/gitlab/authorized_keys.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/gitlab/authorized_keys.rb b/lib/gitlab/authorized_keys.rb index 711d0464087..609d2bd9c77 100644 --- a/lib/gitlab/authorized_keys.rb +++ b/lib/gitlab/authorized_keys.rb @@ -102,12 +102,10 @@ module Gitlab def lock(timeout = 10) File.open("#{authorized_keys_file}.lock", "w+") do |f| - begin - f.flock File::LOCK_EX - Timeout.timeout(timeout) { yield } - ensure - f.flock File::LOCK_UN - end + f.flock File::LOCK_EX + Timeout.timeout(timeout) { yield } + ensure + f.flock File::LOCK_UN end end |
