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:
authorYorick Peterse <yorickpeterse@gmail.com>2019-03-05 18:09:33 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2019-03-12 13:10:40 +0300
commit31fb547f6c648f1929c665cb7b11c271a13e24ff (patch)
tree6aad4b49b5c71a23c39192a4683e94b0f079fff5 /lib/gitlab/gitaly_client
parent5d654a224fef19adec43ca7f8a7da51c131616fc (diff)
Backport Gitaly dynamic timeouts from EE
EE added the ability to set timeouts when handling blobs. Since there's no particular reason for this to be EE specific we can just backport this to CE.
Diffstat (limited to 'lib/gitlab/gitaly_client')
-rw-r--r--lib/gitlab/gitaly_client/ref_service.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/gitlab/gitaly_client/ref_service.rb b/lib/gitlab/gitaly_client/ref_service.rb
index d5633d167ac..6f6698607d9 100644
--- a/lib/gitlab/gitaly_client/ref_service.rb
+++ b/lib/gitlab/gitaly_client/ref_service.rb
@@ -84,15 +84,22 @@ module Gitlab
commits
end
- def list_new_blobs(newrev, limit = 0)
+ def list_new_blobs(newrev, limit = 0, dynamic_timeout: nil)
request = Gitaly::ListNewBlobsRequest.new(
repository: @gitaly_repo,
commit_id: newrev,
limit: limit
)
+ timeout =
+ if dynamic_timeout
+ [dynamic_timeout, GitalyClient.medium_timeout].min
+ else
+ GitalyClient.medium_timeout
+ end
+
response = GitalyClient
- .call(@storage, :ref_service, :list_new_blobs, request, timeout: GitalyClient.medium_timeout)
+ .call(@storage, :ref_service, :list_new_blobs, request, timeout: timeout)
response.flat_map do |msg|
# Returns an Array of Gitaly::NewBlobObject objects