phobos_db_checkpoint 2.0.0 → 2.1.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: 47d3c3c0a71e7cbfe6ddd92f5359ad16046a1110
4
- data.tar.gz: 8b723b38f8e4bf198431d8f35962f8f15dfab1e3
3
+ metadata.gz: ea63b526570ad002da5a794c62996da502e5c1a0
4
+ data.tar.gz: aa0d11a57a7b1a8e1e4fae8cbf2b44b355a8820c
5
5
  SHA512:
6
- metadata.gz: 3934da2a3e942054d650f72a505df277431ed9031650a33c72b8a7d3429a9fa4080ed320db82d586345e994b33cfc279f6eae088f34fd189a8535ebab2e6cf5b
7
- data.tar.gz: 8acf9281d9a4c00910216ee8e70c345d033dc24a30d3275c374123e03549145da9834bed72cc186e96d9bcbe100a0cc62c6d5d4e5a59df67cb8ba701490f2bc8
6
+ metadata.gz: 29faf1557b51e8f2f018a1e909bfef242835407be93852b248a349a800ace8e0c095cf431e79c9bc9608393d04b9d11c672e7402584d485759f507267dd238af
7
+ data.tar.gz: 41ba356743214315af3435827c92d5772fd4fcc0ad54f7d0549d0ffcbbd82a6f964ff431b716b885dff038fcbe24f6b87abcb393a7028ec683fc1c31b0193438
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## 2.1.0 (2017-03-07)
8
+
9
+ - [enhancement] When retrying failures, an event is created if they return an ack
10
+
7
11
  ## 2.0.0 (2017-03-01)
8
12
 
9
13
  - [enhancement] Rename tables
@@ -1,23 +1,31 @@
1
1
  module PhobosDBCheckpoint
2
2
  class RetryFailure
3
+ include PhobosDBCheckpoint::Handler
4
+
3
5
  def initialize(failure)
4
6
  @failure = failure
7
+ @action_taken = nil
5
8
  end
6
9
 
7
10
  def perform
8
- result = retry_failure!
11
+ self
12
+ .class
13
+ .around_consume(payload, metadata) do
14
+ @action_taken = handler.consume(payload, metadata)
15
+ end
16
+
9
17
  @failure.destroy
10
- result
18
+ @action_taken
11
19
  end
12
20
 
13
21
  private
14
22
 
15
- def retry_failure!
16
- handler
17
- .consume(
18
- @failure.payload.to_json,
19
- @failure.metadata.merge(retry_count: 0)
20
- )
23
+ def payload
24
+ @failure.payload.to_json
25
+ end
26
+
27
+ def metadata
28
+ @failure.metadata.merge(retry_count: 0)
21
29
  end
22
30
 
23
31
  def handler
@@ -1,3 +1,3 @@
1
1
  module PhobosDBCheckpoint
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phobos_db_checkpoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Túlio Ornelas
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2017-03-01 00:00:00.000000000 Z
16
+ date: 2017-03-08 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler