stripe 1.53.0 → 1.54.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aaac101c727d5f284f347ff3b73db94988bf1a00
4
- data.tar.gz: f5d117727672e52096a19eb9e318cf61537480a9
3
+ metadata.gz: 2e8c4b76709e3ec68cbde150b1a649435e1e1f29
4
+ data.tar.gz: 702b785a0995a4eb697a97ff3b6699c54e139d37
5
5
  SHA512:
6
- metadata.gz: cd86ad3e6fcd4dbef56323ce43076d9649c39a6f29e46b996c9144e215d480f8192e6d538b7986d6ac403d6f1347caa8cbdac4eeaddd9c7e2f9e5c85359b7ef5
7
- data.tar.gz: 2d7d177a707880c9000a4291ab2e453f8d9cd9d2384097860519aed751722b69988e7410c89980d5a40f9a6e05fa2e64898a7fd0a23dc1e8bfc3c2d8cf9425d5
6
+ metadata.gz: e00542306c9b283d4a982fc5cdfce20e64f955517cca663baa0c2f6f5e9c0da7851f8895b9fa71c447e7fdfa785faa465cec2a930ec0064f3842bfbbcc9a247d
7
+ data.tar.gz: 5dd42345b9e9722cb4512010f6cffa56bac39c9ddcb4acfff228135fd3d4ac44c3098ca8f25abc7f371472a377c16783fad160ca545b454f23447ef3e65d1025
@@ -1,3 +1,7 @@
1
+ === 1.54.0 2016-09-01
2
+
3
+ * Whitelist errors that should be retried; scope to known socket and HTTP errors
4
+
1
5
  === 1.53.0 2016-08-31
2
6
 
3
7
  * Relax version constraint on rest-client (and by extension mime-types) for users on Ruby 2+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.53.0
1
+ 1.54.0
@@ -70,10 +70,22 @@ require 'stripe/errors/rate_limit_error'
70
70
  module Stripe
71
71
  DEFAULT_CA_BUNDLE_PATH = File.dirname(__FILE__) + '/data/ca-certificates.crt'
72
72
 
73
- # HTTP status exceptions which we'd like to retry. Most HTTP status
74
- # exceptions are from a Stripe API server response, so we generally _don't_
75
- # retry because doing so would have the same result as the original request.
76
- RETRY_HTTP_EXCEPTIONS = [
73
+ # Exceptions which we'd like to retry. This includes both socket errors that
74
+ # may represent an intermittent problem and some special HTTP statuses.
75
+ RETRY_EXCEPTIONS = [
76
+ # Destination refused the connection. This could occur from a single
77
+ # saturated server, so retry in case it's intermittent.
78
+ Errno::ECONNREFUSED,
79
+
80
+ # Connection reset. This occasionally occurs on a server problem, and
81
+ # deserves a retry because the server should terminate all requests
82
+ # properly even if they were invalid.
83
+ Errno::ECONNRESET,
84
+
85
+ # Timed out making the connection. It's worth retrying under this
86
+ # circumstance.
87
+ Errno::ETIMEDOUT,
88
+
77
89
  # A server may respond with a 409 to indicate that there is a concurrent
78
90
  # request executing with the same idempotency key. In the case that a
79
91
  # request failed due to a connection problem and the client has retried too
@@ -442,18 +454,8 @@ module Stripe
442
454
  end
443
455
 
444
456
  def self.should_retry?(e, retry_count)
445
- return false if retry_count >= self.max_network_retries
446
-
447
- # Certificate validation problem: do not retry.
448
- return false if e.is_a?(RestClient::SSLCertificateNotVerified)
449
-
450
- # Generally don't retry when we got a successful response back from the
451
- # Stripe API server, but with some exceptions (for more details, see notes
452
- # on RETRY_HTTP_EXCEPTIONS).
453
- return false if e.is_a?(RestClient::ExceptionWithResponse) &&
454
- !RETRY_HTTP_EXCEPTIONS.any? { |klass| e.is_a?(klass) }
455
-
456
- return true
457
+ retry_count < self.max_network_retries &&
458
+ RETRY_EXCEPTIONS.any? { |klass| e.is_a?(klass) }
457
459
  end
458
460
 
459
461
  def self.sleep_time(retry_count)
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.53.0'
2
+ VERSION = '1.54.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.53.0
4
+ version: 1.54.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-31 00:00:00.000000000 Z
11
+ date: 2016-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client