diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /lib/gitaly/server.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
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 |