From 3213e0ecd2a29d2bb4224a8c90fc6662388aa0e1 Mon Sep 17 00:00:00 2001 From: jiikko Date: Thu, 29 Oct 2020 13:22:46 +0900 Subject: [PATCH] Set timeout of HTTPClient with 5 minutes --- lib/deploygate/api/v1/base.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/deploygate/api/v1/base.rb b/lib/deploygate/api/v1/base.rb index 8109a7e..a40b220 100644 --- a/lib/deploygate/api/v1/base.rb +++ b/lib/deploygate/api/v1/base.rb @@ -45,7 +45,11 @@ def post(path, params, &process_block) private def client - HTTPClient.new(:agent_name => "dg/#{DeployGate::VERSION}") + timeout = 60 * 5 # 5 minutes + HTTPClient.new(agent_name: "dg/#{DeployGate::VERSION}").tap do |c| + c.receive_timeout = timeout + c.send_timeout = timeout + end end def headers