From 21dbcf7e43bd8b00f58c5a328cd128b71c92c2dd Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 5 Jun 2017 13:57:22 +0200 Subject: Avoid 2 IO operations when FS is not responding --- lib/gitlab/git/storage/circuit_breaker.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/gitlab/git/storage/circuit_breaker.rb b/lib/gitlab/git/storage/circuit_breaker.rb index f2c52d696cb..fbcdd3aa6d0 100644 --- a/lib/gitlab/git/storage/circuit_breaker.rb +++ b/lib/gitlab/git/storage/circuit_breaker.rb @@ -46,9 +46,8 @@ module Gitlab end def storage_accessible? - return false unless File.directory?(storage_path) - - Pathname.new(storage_path).realpath + realpath = Pathname.new(storage_path).realpath + File.directory?(realpath) rescue Errno::EIO, Errno::ENOENT false end -- cgit v1.2.1