phobos_db_checkpoint 2.4.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/lib/phobos_db_checkpoint/events_api.rb +15 -34
- data/lib/phobos_db_checkpoint/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a9ba4e821b9552c4fd12f90be65887db89a2669
|
4
|
+
data.tar.gz: fd5f101130295300da441409785f3e14e59ddb97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc31093b89408d7fc46da39312f5f1b0c5c5a53136b7b883f44833ae6159f4b8e105a62c60179b5e86a3db28168f95fbc6b2c72738e2873597c6dd5a1bcc7200
|
7
|
+
data.tar.gz: d302eee137c525ac9810777a8ca5785de71ac0e89a3b10bf245fdbd8415c22f4a9d6251ac42e2c72fe0de155924c59ea5513a7ff34dab708608d850cab13e91b
|
data/.gitignore
CHANGED
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
|
+
## 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
|
-
|
14
|
-
|
15
|
-
{ error: true, message: 'not found' }.to_json
|
13
|
+
configure do
|
14
|
+
set(:raise_errors, false)
|
16
15
|
end
|
17
16
|
|
18
|
-
|
17
|
+
not_found do
|
19
18
|
content_type :json
|
20
|
-
|
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
|
22
|
+
error do
|
26
23
|
content_type :json
|
27
|
-
|
28
|
-
|
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
|
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:
|
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-
|
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.
|
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
|