summaryrefslogtreecommitdiff
path: root/lib/gitlab/gitaly_client.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 09:08:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 09:08:10 +0000
commit82fa8a3d1e8466ef36b58604d20fcc145ea12118 (patch)
treec5c0286537405c2fa7719ecce3ed0d73d947c555 /lib/gitlab/gitaly_client.rb
parent232655bf32cd474d54de357b65ef43d77271117c (diff)
downloadgitlab-ce-82fa8a3d1e8466ef36b58604d20fcc145ea12118.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/gitaly_client.rb')
-rw-r--r--lib/gitlab/gitaly_client.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index 4b5455c0ec9..3b9402da0dd 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -42,7 +42,7 @@ module Gitlab
klass = stub_class(name)
addr = stub_address(storage)
creds = stub_creds(storage)
- klass.new(addr, creds, interceptors: interceptors)
+ klass.new(addr, creds, interceptors: interceptors, channel_args: channel_args)
end
end
end
@@ -54,6 +54,16 @@ module Gitlab
end
private_class_method :interceptors
+ def self.channel_args
+ # These values match the go Gitaly client
+ # https://gitlab.com/gitlab-org/gitaly/-/blob/bf9f52bc/client/dial.go#L78
+ {
+ 'grpc.keepalive_time_ms': 20000,
+ 'grpc.keepalive_permit_without_calls': 1
+ }
+ end
+ private_class_method :channel_args
+
def self.stub_cert_paths
cert_paths = Dir["#{OpenSSL::X509::DEFAULT_CERT_DIR}/*"]
cert_paths << OpenSSL::X509::DEFAULT_CERT_FILE if File.exist? OpenSSL::X509::DEFAULT_CERT_FILE