phobos_db_checkpoint 2.4.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf1acf64ea813f8cb9792590b097bb06b51d1d03
4
- data.tar.gz: 6cb678a0dadce2934649f783c6c94088df37c050
3
+ metadata.gz: 5a9ba4e821b9552c4fd12f90be65887db89a2669
4
+ data.tar.gz: fd5f101130295300da441409785f3e14e59ddb97
5
5
  SHA512:
6
- metadata.gz: 0eb6e9f11c3132971004a9cd91745d8ef98db6bfb7faa8c44a9ebf383b5fd23389ec9eb3c3b773370be82be499a065fc50fff8402f74ccb2c6db3825539689c3
7
- data.tar.gz: f94917fc2b4dcd8c27b7cdc0b4fdfe961792fb569f8a16db02dc691fb5b37f25709b1026f79a81773a96ac0ad0de19187ccc560e1e37f7f1e4e024be2f134fd5
6
+ metadata.gz: cc31093b89408d7fc46da39312f5f1b0c5c5a53136b7b883f44833ae6159f4b8e105a62c60179b5e86a3db28168f95fbc6b2c72738e2873597c6dd5a1bcc7200
7
+ data.tar.gz: d302eee137c525ac9810777a8ca5785de71ac0e89a3b10bf245fdbd8415c22f4a9d6251ac42e2c72fe0de155924c59ea5513a7ff34dab708608d850cab13e91b
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/tmp/
15
15
  .byebug_history
16
16
  log/
17
17
  spec/log/
18
+ .idea
@@ -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
+ ## 3.0.0 (2017-03-21)
8
+
9
+ - [enhancement] Remove endpoint for retrying events
10
+
7
11
  ## 2.4.0 (2017-03-13)
8
12
 
9
13
  - [enhancement] Add endpoint for retrieving the number of failures
@@ -10,22 +10,27 @@ module PhobosDBCheckpoint
10
10
  VERSION = :v1
11
11
  set :logging, nil
12
12
 
13
- not_found do
14
- content_type :json
15
- { error: true, message: 'not found' }.to_json
13
+ configure do
14
+ set(:raise_errors, false)
16
15
  end
17
16
 
18
- error ActiveRecord::RecordNotFound do
17
+ not_found do
19
18
  content_type :json
20
- status 404
21
- type = env['sinatra.route'].match(/\/.+\/(.+)\/:/)[1].chop
22
- { error: true, message: "#{type} not found" }.to_json
19
+ { error: true, message: 'not found' }.to_json
23
20
  end
24
21
 
25
- error StandardError do
22
+ error do
26
23
  content_type :json
27
- error = env['sinatra.error']
28
- { error: true, message: error.message }.to_json
24
+ exception = env['sinatra.error']
25
+ case exception
26
+ when ActiveRecord::RecordNotFound
27
+ status 404
28
+ type = env['sinatra.route'].match(/\/.+\/(.+)\/:/)[1].chop
29
+ { error: true, message: "#{type} not found" }.to_json
30
+ else
31
+ status 500
32
+ { error: true, message: exception.message }.to_json
33
+ end
29
34
  end
30
35
 
31
36
  get '/ping' do
@@ -39,30 +44,6 @@ module PhobosDBCheckpoint
39
44
  .to_json
40
45
  end
41
46
 
42
- post "/#{VERSION}/events/:id/retry" do
43
- content_type :json
44
- event = PhobosDBCheckpoint::Event.find(params['id'])
45
- metadata = {
46
- listener_id: 'events_api/retry',
47
- group_id: event.group_id,
48
- topic: event.topic,
49
- retry_count: 0
50
- }
51
-
52
- event_action =
53
- begin
54
- event
55
- .configured_handler
56
- .new
57
- .consume(event.payload, metadata)
58
- rescue ListenerNotFoundError => e
59
- status 422
60
- return { error: true, message: e.message }.to_json
61
- end
62
-
63
- { acknowledged: event_action.is_a?(PhobosDBCheckpoint::Ack) }.to_json
64
- end
65
-
66
47
  get "/#{VERSION}/events" do
67
48
  content_type :json
68
49
  limit = (params['limit'] || 20).to_i
@@ -1,3 +1,3 @@
1
1
  module PhobosDBCheckpoint
2
- VERSION = '2.4.0'
2
+ VERSION = '3.0.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.4.0
4
+ version: 3.0.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-13 00:00:00.000000000 Z
16
+ date: 2017-03-22 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler
@@ -294,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
294
294
  version: '0'
295
295
  requirements: []
296
296
  rubyforge_project:
297
- rubygems_version: 2.6.8
297
+ rubygems_version: 2.5.1
298
298
  signing_key:
299
299
  specification_version: 4
300
300
  summary: Phobos DB Checkpoint is a plugin to Phobos and is meant as a drop in replacement