diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-01 09:08:28 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-01 09:08:28 +0000 |
commit | c6e6762bbf9fa3e38f37a886237c6e920f6c409c (patch) | |
tree | df600ebc6d4531716502797999e1f8d1797e669a /lib/gitaly | |
parent | ec884edd4678e35a8c011242aa8bc92ec35fdac5 (diff) | |
download | gitlab-ce-c6e6762bbf9fa3e38f37a886237c6e920f6c409c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitaly')
-rw-r--r-- | lib/gitaly/server.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/gitaly/server.rb b/lib/gitaly/server.rb index 89a836e629f..a816dd89e9c 100644 --- a/lib/gitaly/server.rb +++ b/lib/gitaly/server.rb @@ -3,6 +3,7 @@ module Gitaly class Server SHA_VERSION_REGEX = /\A\d+\.\d+\.\d+-\d+-g([a-f0-9]{8})\z/.freeze + DEFAULT_REPLICATION_FACTOR = 1 class << self def all @@ -16,6 +17,10 @@ module Gitaly def filesystems all.map(&:filesystem_type).compact.uniq end + + def gitaly_clusters + all.count { |g| g.replication_factor > DEFAULT_REPLICATION_FACTOR } + end end attr_reader :storage @@ -73,6 +78,10 @@ module Gitaly "Error getting the address: #{e.message}" end + def replication_factor + storage_status&.replication_factor + end + private def storage_status |