diff options
Diffstat (limited to 'lib/gitaly/server.rb')
-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 |