From 24b5cfd6124d8260b052cd3489ce0a8c77c8eeb1 Mon Sep 17 00:00:00 2001 From: Chris Zetter <253059100+zetter-rpf@users.noreply.github.com> Date: Fri, 16 Oct 2026 09:08:33 +0100 Subject: [PATCH] Configure timeouts HTTP requests We don't currently have timeout configured, which means they are quite large (30-60 seconds) and can exhaust dynos. Configure timeouts. These are quite generous - I would expect 1s should be enough for most requests, but we don't have good visibility on this for the moment. I've chosen to start with 5/10 seconds and then we can always ratchet this down further in the future. The timeouts are documented in: https://redirect.github.com/lostisland/faraday/blob/main/lib/faraday/options/request_options.rb#L16-L29 --- lib/http_client.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/http_client.rb b/lib/http_client.rb index 01d702298..686c8fa53 100644 --- a/lib/http_client.rb +++ b/lib/http_client.rb @@ -4,6 +4,17 @@ module HttpClient def self.new(url = nil, options = {}) + default_options = { + request: { + read_timeout: 5, + open_timeout: 5, + write_timeout: 5, + timeout: 10 + } + } + + options = default_options.deep_merge(options) + Faraday.new(url, options) do |f| f.use RecordRequestHostInErrors yield f