diff options
-rw-r--r-- | lib/gitaly_client.rb | 3 | ||||
-rw-r--r-- | lib/gitlab_post_receive.rb | 3 | ||||
-rw-r--r-- | lib/http_client.rb | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/gitaly_client.rb b/lib/gitaly_client.rb index 66ea655..aa63abe 100644 --- a/lib/gitaly_client.rb +++ b/lib/gitaly_client.rb @@ -11,7 +11,8 @@ class GitalyClient < HttpClient url = "#{gitaly_url}/post-receive" params = { project: sanitize_path(repo_path) } - resp = post(url, params) + # NOTE: Consider being more permisive with gitaly once it's more robust + resp = post(url, params, read_timeout: 5) resp.code == '200' end diff --git a/lib/gitlab_post_receive.rb b/lib/gitlab_post_receive.rb index ee908d8..950066e 100644 --- a/lib/gitlab_post_receive.rb +++ b/lib/gitlab_post_receive.rb @@ -37,7 +37,8 @@ class GitlabPostReceive end print_merge_request_links(merge_request_urls) - result &&= notify_gitaly + # NOTE: Consider checking Gitaly's success once it's robust and mandatory + notify_gitaly rescue HttpClient::ApiUnreachableError nil end diff --git a/lib/http_client.rb b/lib/http_client.rb index 3c3c242..017bd04 100644 --- a/lib/http_client.rb +++ b/lib/http_client.rb @@ -91,8 +91,8 @@ class HttpClient request(:get, url, {}, options) end - def post(url, params) - request(:post, url, params) + def post(url, params, options = {}) + request(:post, url, params, options) end def cert_store |