From 2d35fce9fefbdb52781fd36f3eb06a9af5916f2e Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 20 Aug 2024 16:21:00 +0200 Subject: [PATCH] Add #close (#23) --- lib/faraday/adapter/net_http_persistent.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/faraday/adapter/net_http_persistent.rb b/lib/faraday/adapter/net_http_persistent.rb index f3849cf..b601bd2 100644 --- a/lib/faraday/adapter/net_http_persistent.rb +++ b/lib/faraday/adapter/net_http_persistent.rb @@ -56,6 +56,10 @@ def call(env) raise Faraday::TimeoutError, e end + def close + @cached_connection&.shutdown + end + private def build_connection(env)