summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-10-13 15:21:06 +0200
committerJacob Vosmaer <jacob@gitlab.com>2017-10-13 15:21:06 +0200
commit82352e13f52c4549e5ccd210cfb5fc0b26157e01 (patch)
tree5fb86cad89519a52f4818fd467e5b51acebcdbf8
parent0a40b14d3e10ebba043e0c42050ec397473edec5 (diff)
downloadgitlab-ce-gitaly-call-kwargs.tar.gz
Improve commentgitaly-call-kwargs
-rw-r--r--lib/gitlab/gitaly_client.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index c1a64d04307..6c1ae19ff11 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -70,10 +70,18 @@ module Gitlab
# All Gitaly RPC call sites should use GitalyClient.call. This method
# makes sure that per-request authentication headers are set.
- #
+ #
# This method optionally takes a block which receives the keyword
# arguments hash 'kwargs' that will be passed to gRPC. This allows the
- # caller to modify or augment the keyword arguments.
+ # caller to modify or augment the keyword arguments. The block must
+ # return a hash.
+ #
+ # For example:
+ #
+ # GitalyClient.call(storage, service, rpc, request) do |kwargs|
+ # kwargs.merge(deadline: Time.now + 10)
+ # end
+ #
def self.call(storage, service, rpc, request)
enforce_gitaly_request_limits(:call)