summaryrefslogtreecommitdiff
path: root/config/initializers/8_gitaly.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/8_gitaly.rb')
-rw-r--r--config/initializers/8_gitaly.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/config/initializers/8_gitaly.rb b/config/initializers/8_gitaly.rb
index e4a505a8ba4..69c0a91d6f0 100644
--- a/config/initializers/8_gitaly.rb
+++ b/config/initializers/8_gitaly.rb
@@ -1,4 +1,18 @@
-# Make sure we initialize a Gitaly channel before Sidekiq starts multi-threaded execution.
-Gitlab.config.repositories.storages.each do |name, params|
- Gitlab::GitalyClient.configure_channel(name, params['socket_path'])
+require 'uri'
+
+# Make sure we initialize our Gitaly channels before Sidekiq starts multi-threaded execution.
+if Gitlab.config.gitaly.enabled || Rails.env.test?
+ Gitlab.config.repositories.storages.each do |name, params|
+ address = params['gitaly_address']
+
+ unless address.present?
+ raise "storage #{name.inspect} is missing a gitaly_address"
+ end
+
+ unless URI(address).scheme == 'unix'
+ raise "Unsupported Gitaly address: #{address.inspect}"
+ end
+
+ Gitlab::GitalyClient.configure_channel(name, address)
+ end
end