stripe 5.0.0 → 5.0.1
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/stripe/connection_manager.rb +13 -6
- data/lib/stripe/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85172888973b3726ad9e22512ff8b2568306b70d1627c5ee3adafb29c9626e07
|
4
|
+
data.tar.gz: 89344233f7ba4423b5fbc35b30152dec1b5f798931a5b69710d244ea05146b98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e48a09594870a21082733d2b9a7ef9eb9bc27d757de666bb1fbab25b1aa9143c3ad1c2e610a13199395efd36f8d3b71f1d601dd3e03da1a69911e5be46074c5a
|
7
|
+
data.tar.gz: 1d376a59eb9072debb80e3c17b1fb6961d766f780c5d81b2771773018616ce4a8e049933537a9ba5a334df774b9307fbf0105af790bbc2ee7a0089d54441ee98
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 5.0.1 - 2019-08-20
|
4
|
+
* [#836](https://github.com/stripe/stripe-ruby/pull/836) Increase connection keep alive timeout to 30 seconds
|
5
|
+
|
3
6
|
## 5.0.0 - 2019-08-20
|
4
7
|
Major version release. The [migration guide](https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v5) contains a detailed list of backwards-incompatible changes with upgrade instructions.
|
5
8
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.0.
|
1
|
+
5.0.1
|
@@ -11,10 +11,10 @@ module Stripe
|
|
11
11
|
# instantiated once per thread.
|
12
12
|
#
|
13
13
|
# Note also that this class doesn't currently clean up after itself because
|
14
|
-
# it expects to only ever have a few connections
|
15
|
-
# memory by constantly changing the value
|
16
|
-
# possible improvement might be to detect
|
17
|
-
# a request is executed.
|
14
|
+
# it expects to only ever have a few connections (unless `.clear` is called
|
15
|
+
# manually). It'd be possible to tank memory by constantly changing the value
|
16
|
+
# of `Stripe.api_base` or the like. A possible improvement might be to detect
|
17
|
+
# and prune old connections whenever a request is executed.
|
18
18
|
class ConnectionManager
|
19
19
|
def initialize
|
20
20
|
@active_connections = {}
|
@@ -40,8 +40,6 @@ module Stripe
|
|
40
40
|
|
41
41
|
if connection.nil?
|
42
42
|
connection = create_connection(u)
|
43
|
-
|
44
|
-
# TODO: what happens after TTL?
|
45
43
|
connection.start
|
46
44
|
|
47
45
|
@active_connections[[u.host, u.port]] = connection
|
@@ -92,6 +90,15 @@ module Stripe
|
|
92
90
|
proxy_host, proxy_port,
|
93
91
|
proxy_user, proxy_pass)
|
94
92
|
|
93
|
+
# Time in seconds within which Net::HTTP will try to reuse an already
|
94
|
+
# open connection when issuing a new operation. Outside this window, Ruby
|
95
|
+
# will transparently close and re-open the connection without trying to
|
96
|
+
# reuse it.
|
97
|
+
#
|
98
|
+
# Ruby's default of 2 seconds is almost certainly too short. Here I've
|
99
|
+
# reused Go's default for `DefaultTransport`.
|
100
|
+
connection.keep_alive_timeout = 30
|
101
|
+
|
95
102
|
connection.open_timeout = Stripe.open_timeout
|
96
103
|
connection.read_timeout = Stripe.read_timeout
|
97
104
|
|
data/lib/stripe/version.rb
CHANGED