minato_ruby_api_client 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 430a3104ab0c69e3c62ba990f3fb91029a85f257525c56e6a35f58b88a9a94bd
4
- data.tar.gz: eec830c93eab4c0f5b395adf4f1b65a93c8b92add998c7d095b9adb10f0c0249
3
+ metadata.gz: 67f7f0e5c35c222867f68158717831cb029cdc6b445113a33335a2336be337f7
4
+ data.tar.gz: 598a2224f1082f5f8aa1f126fc5621acb0514118c3c29002f55d450e45b6c9d5
5
5
  SHA512:
6
- metadata.gz: '0119f09dc1d07e5901b65979adfcc4025f269fbdc321861790fa78562dd18bf49ef093d76473ae160e92982c8e585eb0ef4972e77ea02eaa11935e668feadb19'
7
- data.tar.gz: f5040c62fb32554a3fa83c14b9368a6d7e0647d629dca7aafd125442b0e3816c38eb580977f12479d501093cee7561d8a9383023d18d5719a3e9ddad48ae8d80
6
+ metadata.gz: ff523a40ac50433b9b3b37b0d73e077f4af7e2351c664e16d35e86b69b79567978cd28e8136e996cd44b349f50cf185bafd2acbcd08a119bd6e77d09b392c724
7
+ data.tar.gz: d8701418132c6464f75bbc32f52c687da2dc475f7b347676ddb0d138cad6c178f79a483141d88574e11072e0fd8f4c1c3aa9808382227e5046d3e70f535416c1
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.2]
9
+
10
+ ### Fixed
11
+
12
+ - Stop leaking one persistent `async_http` client per request on the calling thread. `call_api` builds a new Faraday connection for every request, and the adapter's default `PerThreadPersistentClients` stored each one in a thread variable that was never released, so memory grew with every request for the lifetime of the thread (the main thread of a Falcon worker). The adapter now uses `Async::HTTP::Faraday::Clients`, which closes the client when the request finishes.
13
+
8
14
  ## [0.3.0]
9
15
 
10
16
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minato_ruby_api_client (0.3.0)
4
+ minato_ruby_api_client (0.3.2)
5
5
  async-http-faraday (>= 0.19)
6
6
  faraday (>= 2.0, < 3.0)
7
7
  minato-trace (>= 0.2.0)
@@ -1,6 +1,7 @@
1
1
  require 'date'
2
2
  require 'json'
3
3
  require 'logger'
4
+ require 'socket'
4
5
  require 'tempfile'
5
6
  require 'time'
6
7
  require 'faraday'
@@ -58,7 +59,7 @@ module MinatoRubyApiClient
58
59
  conn.request :multipart
59
60
  conn.request :url_encoded
60
61
  end
61
- conn.adapter(:async_http)
62
+ conn.adapter(:async_http, clients: Async::HTTP::Faraday::Clients)
62
63
  end
63
64
 
64
65
  request = nil
@@ -1,3 +1,3 @@
1
1
  module MinatoRubyApiClient
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.2'
3
3
  end
@@ -119,6 +119,15 @@ describe MinatoRubyApiClient::ApiClient do
119
119
  end
120
120
  end
121
121
 
122
+ context 'when called repeatedly on the same thread' do
123
+ it 'does not retain HTTP clients on the thread' do
124
+ api_client.call_api(:post, '/test', opts)
125
+
126
+ expect { 3.times { api_client.call_api(:post, '/test', opts) } }
127
+ .not_to(change { Thread.current.thread_variables.size })
128
+ end
129
+ end
130
+
122
131
  context 'when request failed' do
123
132
  let(:http_response) do
124
133
  { status: [400, 'Bad Request'], headers: { 'Context-type': 'application/json' },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minato_ruby_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ferreri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-07 00:00:00.000000000 Z
11
+ date: 2026-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday