take2 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +10 -1
- data/README.md +2 -3
- data/lib/take2.rb +1 -1
- data/lib/take2/configuration.rb +0 -1
- data/lib/take2/version.rb +1 -1
- data/spec/take2/configuration_spec.rb +1 -2
- data/spec/take2_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e1527877f8368992454961e227f3c12d5eee2249bb2585accfd2cd0f6d395d12
|
4
|
+
data.tar.gz: 06a69e8b6404ac91625766cff5dbc5ac4bd1cf8f137986ab5c541d4fc36da82f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2691c3b01a60440020e9e68585cf3b1245b3c4a7985f1216686353b0d030494e1a4b8520bb46b44f701b5b1e88fa3d28032b515da09d93335b9cea7b89164ac
|
7
|
+
data.tar.gz: d5ff1f23f6d487b86f3d3b3cf023fb8e568237c2578015bd350ccee011c5544efbb08478afb84f93c2bc5b57c6f010eec0b807e0bebba8c3f40617d87151d018
|
data/CHANGELOG.md
CHANGED
@@ -2,4 +2,13 @@
|
|
2
2
|
#
|
3
3
|
* Add class validations for class helper methods
|
4
4
|
* Add basic documentation
|
5
|
-
|
5
|
+
#
|
6
|
+
0.0.2
|
7
|
+
#
|
8
|
+
* Add more tests
|
9
|
+
#
|
10
|
+
v0.0.3
|
11
|
+
* Fix configurations bug (#4)
|
12
|
+
* Ability to set custom configurations on method call (#1)
|
13
|
+
* More tests (#3)
|
14
|
+
* Update docs and badges
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ class KratosService
|
|
22
22
|
number_of_retries 3
|
23
23
|
|
24
24
|
# Could be configured globally or on class level.
|
25
|
-
retriable_errors Net::HTTPRetriableError, Net::
|
25
|
+
retriable_errors Net::HTTPRetriableError, Net::HTTPServerException
|
26
26
|
|
27
27
|
# Retry unless the response status is 5xx. The implementation is dependent of the http lib in use.
|
28
28
|
retriable_condition proc { |error| error.response.code < 500 }
|
@@ -79,8 +79,7 @@ KratosService.retriable_configuration
|
|
79
79
|
|
80
80
|
Take2.configure do |config|
|
81
81
|
config.retries = 3
|
82
|
-
config.retriable = [
|
83
|
-
Net::HTTPServerError,
|
82
|
+
config.retriable = [
|
84
83
|
Net::HTTPServerException,
|
85
84
|
Net::HTTPRetriableError,
|
86
85
|
Errno::ECONNRESET,
|
data/lib/take2.rb
CHANGED
@@ -41,7 +41,7 @@ module Take2
|
|
41
41
|
# include Take2
|
42
42
|
#
|
43
43
|
# number_of_retries 3
|
44
|
-
# retriable_errors Net::HTTPRetriableError
|
44
|
+
# retriable_errors Net::HTTPRetriableError
|
45
45
|
# retriable_condition proc { |error| response_status(error.response) < 500 }
|
46
46
|
# on_retry proc { |error, tries| puts "#{self.name} - Retrying.. #{tries} of #{self.retriable_configuration[:retries]} (#{error})" }
|
47
47
|
# sleep_before_retry 3
|
data/lib/take2/configuration.rb
CHANGED
data/lib/take2/version.rb
CHANGED
@@ -11,8 +11,7 @@ RSpec.describe Take2::Configuration do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'has correct default retriable errors array' do
|
14
|
-
expect(default.retriable).to eql [
|
15
|
-
Net::HTTPServerError,
|
14
|
+
expect(default.retriable).to eql [
|
16
15
|
Net::HTTPServerException,
|
17
16
|
Net::HTTPRetriableError,
|
18
17
|
Errno::ECONNRESET,
|
data/spec/take2_spec.rb
CHANGED
@@ -5,7 +5,7 @@ RSpec.describe Take2 do
|
|
5
5
|
let!(:config) do
|
6
6
|
Take2.configure do |c|
|
7
7
|
c.retries = 1
|
8
|
-
c.retriable = [Net::
|
8
|
+
c.retriable = [Net::HTTPServerException, Net::HTTPRetriableError].freeze
|
9
9
|
c.retry_condition_proc = proc {false}
|
10
10
|
c.retry_proc = proc {}
|
11
11
|
c.time_to_sleep = 0.5
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: take2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Magids
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Retry API calls, methods or blocks of code. Define take2 retry behavior
|
14
14
|
or use defaults and you good to go.
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
|
-
rubygems_version: 2.
|
58
|
+
rubygems_version: 2.7.8
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Provides Take2 for your APIs calls
|