active_utils 3.3.12 → 3.3.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/probots.yml +2 -0
- data/CHANGELOG.md +12 -0
- data/lib/active_utils/network_connection_retries.rb +7 -2
- data/lib/active_utils/version.rb +1 -1
- data/test/unit/network_connection_retries_test.rb +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2419f33b62bb5ac91f29b58e341436e5fd8d636a
|
4
|
+
data.tar.gz: '09d2b0dd502873b3250358165a4d7e05e83174ef'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d891d8cf21711ea9d1f303a96e01ada3e15c05f24916f0c2ea18c1cfed27ff268dede6f1e31cc144640353e6d32896af7c33a2dfcbc9afedb000b72b19e813e
|
7
|
+
data.tar.gz: 9f332193f661283e2e50b3b38d32e70fe4ddf1c32c31d7a1e0f6d1d4f9f3cf15a82cd8a71361a8c38ffdbfe815f3f2cb390214f7e24e8786f168c65e18549710
|
data/.github/probots.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# ActiveUtils changelog
|
2
2
|
|
3
|
+
### Version 3.3.13 (November 26, 2018)
|
4
|
+
- Add support for custom retriable exceptions in `NetworkConnectionRetries#retry_exceptions`
|
5
|
+
|
6
|
+
### Version 3.3.12 (July 11, 2018)
|
7
|
+
- Update CA bundle
|
8
|
+
|
9
|
+
### Version 3.3.11 (March 14, 2018)
|
10
|
+
- Add the DigiCert Global Root G2 to the CA bundle
|
11
|
+
|
12
|
+
### Version 3.3.10 (February 28, 2018)
|
13
|
+
- Support ActiveSupport 5.2
|
14
|
+
|
3
15
|
### Version 3.3.9 (September 28, 2017)
|
4
16
|
- Add remaining currencies to `ActiveUtils::CurrencyCode::ISO_CURRENCIES`
|
5
17
|
- Update bundler in `travis.yml`
|
@@ -10,18 +10,23 @@ module ActiveUtils
|
|
10
10
|
OpenSSL::SSL::SSLError => "The SSL connection to the remote server could not be established"
|
11
11
|
}
|
12
12
|
|
13
|
+
DEFAULT_RETRY_ERRORS = {
|
14
|
+
Errno::ECONNREFUSED => "The remote server refused the connection"
|
15
|
+
}
|
16
|
+
|
13
17
|
def self.included(base)
|
14
18
|
base.send(:attr_accessor, :retry_safe)
|
15
19
|
end
|
16
20
|
|
17
21
|
def retry_exceptions(options={})
|
18
22
|
connection_errors = DEFAULT_CONNECTION_ERRORS.merge(options[:connection_exceptions] || {})
|
23
|
+
retry_errors = DEFAULT_RETRY_ERRORS.merge(options[:retriable_exceptions] || {})
|
19
24
|
|
20
25
|
retry_network_exceptions(options) do
|
21
26
|
begin
|
22
27
|
yield
|
23
|
-
rescue
|
24
|
-
raise ActiveUtils::RetriableConnectionError,
|
28
|
+
rescue *retry_errors.keys => e
|
29
|
+
raise ActiveUtils::RetriableConnectionError, derived_error_message(retry_errors, e.class)
|
25
30
|
rescue OpenSSL::X509::CertificateError => e
|
26
31
|
NetworkConnectionRetries.log(options[:logger], :error, e.message, options[:tag])
|
27
32
|
raise ActiveUtils::ClientCertificateError, "The remote server did not accept the provided SSL certificate"
|
data/lib/active_utils/version.rb
CHANGED
@@ -207,4 +207,12 @@ class NetworkConnectionRetriesTest < Minitest::Test
|
|
207
207
|
end
|
208
208
|
end
|
209
209
|
end
|
210
|
+
|
211
|
+
def test_retries_with_custom_error_specified
|
212
|
+
@requester.expects(:post).times(2).raises(Errno::ETIMEDOUT).then.returns(@ok)
|
213
|
+
|
214
|
+
retry_exceptions retriable_exceptions: { Errno::ETIMEDOUT => "The connection to the remote server timed out"} do
|
215
|
+
@requester.post
|
216
|
+
end
|
217
|
+
end
|
210
218
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -93,6 +93,7 @@ executables: []
|
|
93
93
|
extensions: []
|
94
94
|
extra_rdoc_files: []
|
95
95
|
files:
|
96
|
+
- ".github/probots.yml"
|
96
97
|
- ".gitignore"
|
97
98
|
- ".travis.yml"
|
98
99
|
- CHANGELOG.md
|