evt-retry 2.1.0.0 → 2.2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/retry/retry.rb +4 -3
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b61baf25e206aee4fb92ba9460ffbd7b22e85e0ba05f9637f45af8641d34aeaf
4
- data.tar.gz: 638f8bab2e64630ed34461e93699393e2a1abdee02779eb28f66b593d171b948
3
+ metadata.gz: a9e55c0a3e613ee773aa11308008d44b182b0a4036d1b3902e507dcdb049f842
4
+ data.tar.gz: 3bbd893c7332205a1a7fa9efa8958a0465e8cd7926be9a1b49e32eef38b90476
5
5
  SHA512:
6
- metadata.gz: 435cdb980e1dfd5453777104b2097014fe1d4571fdb9299f53702190652c7e1bd7ccddad6a12de30adf900030e5d4ee5b0bc95a0efbc0a906e2a78a1baf3f825
7
- data.tar.gz: edc641c5aef345da3f04a4da79ee60eec87188d9ec25ca853e663389d8dbc35018a477323231d1e14205673a1b6e3db237fd16b502d48627222021a487c96630
6
+ metadata.gz: 95bcd92c30f286d6cb70957362959b8c9b1d275eb568f4b49fd328439e3aa383946c530302824c88337c6abaf3133db4037b099efbc18997a503f542b4140b0f
7
+ data.tar.gz: c0733af7387be532006201621ed946fa7300c4586c37bbaea5f251b4b253911e03ee3c9d8d252d363aa0eecf173919576d1d7a3e870b7d8e840969ebc982b330
data/lib/retry/retry.rb CHANGED
@@ -13,7 +13,7 @@ class Retry
13
13
  attr_writer :action_executed
14
14
 
15
15
  def self.build
16
- instance = new
16
+ new
17
17
  end
18
18
 
19
19
  def self.configure(receiver, attr_name: nil)
@@ -40,11 +40,12 @@ class Retry
40
40
 
41
41
  error = nil
42
42
  probe = proc { |e| error = e }
43
+ result = nil
43
44
 
44
45
  loop do
45
46
  success = Try.(errors, error_probe: probe) do
46
47
  logger.debug { "Attempting (Cycle: #{cycle})" }
47
- action.call(cycle)
48
+ result = action.call(cycle)
48
49
  end
49
50
 
50
51
  action_executed&.call(cycle)
@@ -79,6 +80,6 @@ class Retry
79
80
  raise error
80
81
  end
81
82
 
82
- cycle
83
+ result
83
84
  end
84
85
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-retry
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.0
4
+ version: 2.2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-08 00:00:00.000000000 Z
11
+ date: 2022-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-try
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  requirements: []
132
- rubygems_version: 3.1.2
132
+ rubygems_version: 3.3.3
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Retry an execution that terminates with an error, with optional backoff cycles