rabbit_feed 2.4.0 → 2.4.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b5abf99a3ec7c000ae4cdce1305089b50a75884
|
4
|
+
data.tar.gz: c4ac6137152be286d2185fce267b8b5e7a92271f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1782920ca72bc88963633bf1c628e8a962850b1bf65c3b31401b87545372c47bcbe0f5ebe877e581b7584ba4ae1aafe775d6d270d684f3c9915d43783d73c94c
|
7
|
+
data.tar.gz: 39c27c3e838126da3d186e133680c1c917758d20d9aabb1d97bd07c079f0065f516a8d138cd2d5cfe0630e7303f0ee9631d1afd658adfa4e1ac7c0979a290de3
|
data/lib/rabbit_feed.rb
CHANGED
@@ -37,7 +37,14 @@ module RabbitFeed
|
|
37
37
|
if defined?(Airbrake::VERSION) && Airbrake::VERSION.to_i < 5
|
38
38
|
(Airbrake.notify_or_ignore exception) if Airbrake.configuration.public?
|
39
39
|
elsif defined?(Airbrake::AIRBRAKE_VERSION) && Airbrake::AIRBRAKE_VERSION.to_i >= 5
|
40
|
-
|
40
|
+
if RabbitFeed.configuration.consumer_exit_after_fail
|
41
|
+
# Will need to send the notification right away, otherwise the `exit` would kill the
|
42
|
+
# Airbrake before the notification is sent out
|
43
|
+
Airbrake.notify_sync exception
|
44
|
+
else
|
45
|
+
# Airbrake notify default to sending notification asynchronously
|
46
|
+
Airbrake.notify exception
|
47
|
+
end
|
41
48
|
end
|
42
49
|
end
|
43
50
|
end
|
data/lib/rabbit_feed/version.rb
CHANGED
@@ -121,9 +121,20 @@ module RabbitFeed
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
|
125
|
-
|
126
|
-
|
124
|
+
context 'and consumer_exit_after_fail is true' do
|
125
|
+
before { allow(RabbitFeed.configuration).to receive(:consumer_exit_after_fail).and_return(true) }
|
126
|
+
it 'notifies airbrake synchronously' do
|
127
|
+
expect(Airbrake).to receive(:notify_sync).with(an_instance_of RuntimeError)
|
128
|
+
expect{ subject.consume { raise 'Consuming time' } }.not_to raise_error
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
context 'and consumer_exit_after_fail is not true' do
|
133
|
+
before { allow(RabbitFeed.configuration).to receive(:consumer_exit_after_fail).and_return(false) }
|
134
|
+
it 'notifies airbrake' do
|
135
|
+
expect(Airbrake).to receive(:notify).with(an_instance_of RuntimeError)
|
136
|
+
expect{ subject.consume { raise 'Consuming time' } }.not_to raise_error
|
137
|
+
end
|
127
138
|
end
|
128
139
|
end
|
129
140
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit_feed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simply Business
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|