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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 14:18:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 14:18:50 +0300
commit8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch)
treea77e7fe7a93de11213032ed4ab1f33a3db51b738 /lib/gitaly
parent00b35af3db1abfe813a778f643dad221aad51fca (diff)
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'lib/gitaly')
-rw-r--r--lib/gitaly/server.rb9
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