Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-12 15:13:59 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-17 12:50:32 +0300
commit619021fd7a6ac68e2821f89f746fea3a72c25e3b (patch)
tree326b20849aec1b2de3ad5fafcd902291504b627d /lib/gitlab/git/storage/null_circuit_breaker.rb
parent85640c5cbbf3e08f562ecbebfeabc64862e85bed (diff)
Read circuitbreaker settings from `Gitlab::CurrentSettings`
Instead of from the configuration file
Diffstat (limited to 'lib/gitlab/git/storage/null_circuit_breaker.rb')
-rw-r--r--lib/gitlab/git/storage/null_circuit_breaker.rb13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/gitlab/git/storage/null_circuit_breaker.rb b/lib/gitlab/git/storage/null_circuit_breaker.rb
index 297c043d054..60c6791a7e4 100644
--- a/lib/gitlab/git/storage/null_circuit_breaker.rb
+++ b/lib/gitlab/git/storage/null_circuit_breaker.rb
@@ -2,15 +2,14 @@ module Gitlab
module Git
module Storage
class NullCircuitBreaker
+ include CircuitBreakerSettings
+
# These will have actual values
attr_reader :storage,
:hostname
# These will always have nil values
- attr_reader :storage_path,
- :failure_wait_time,
- :failure_reset_time,
- :storage_timeout
+ attr_reader :storage_path
def initialize(storage, hostname, error: nil)
@storage = storage
@@ -26,16 +25,12 @@ module Gitlab
!!@error
end
- def failure_count_threshold
- 1
- end
-
def last_failure
circuit_broken? ? Time.now : nil
end
def failure_count
- circuit_broken? ? 1 : 0
+ circuit_broken? ? failure_count_threshold : 0
end
def failure_info