summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-07-26 17:16:59 +0200
committerPawel Chojnacki <pawel@chojnacki.ws>2017-07-26 17:16:59 +0200
commit6ac0a142e00e5bf0945ea624c93bbfe54c91a14e (patch)
tree61abd37152eb00bd3e2b5269c6a70ea55cfd2cea
parent7ce0a61a993f36f30692f93c477f671f82dbef51 (diff)
downloadgitlab-ce-pawel/ensure_temp_files_are_deleted_in_fs_metrics-35457.tar.gz
-rw-r--r--lib/gitlab/health_checks/fs_shards_check.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/gitlab/health_checks/fs_shards_check.rb b/lib/gitlab/health_checks/fs_shards_check.rb
index 928fb014ef4..a4740e9e9b7 100644
--- a/lib/gitlab/health_checks/fs_shards_check.rb
+++ b/lib/gitlab/health_checks/fs_shards_check.rb
@@ -67,12 +67,10 @@ module Gitlab
end
def with_temp_file(storage_name)
- begin
- temp_file_path = Dir::Tmpname.create(%w(fs_shards_check +deleted), storage_path(storage_name)) { |path| path }
- yield temp_file_path
- ensure
- delete_test_file(temp_file_path)
- end
+ temp_file_path = Dir::Tmpname.create(%w(fs_shards_check +deleted), storage_path(storage_name)) { |path| path }
+ yield temp_file_path
+ ensure
+ delete_test_file(temp_file_path)
end
def storage_path(storage_name)