rabbit_feed 2.4.0 → 2.4.1

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: b027daa2e82c9b3cca12bcec5df1cf82a9d27eec
4
- data.tar.gz: a95205ed61bfc7a16b7a6fd2f5e6f33f1f4bf8f3
3
+ metadata.gz: 6b5abf99a3ec7c000ae4cdce1305089b50a75884
4
+ data.tar.gz: c4ac6137152be286d2185fce267b8b5e7a92271f
5
5
  SHA512:
6
- metadata.gz: 2ac970507750197992c5fed39203a12073e0e7ac4a0cce6fe35b5363f6bbc3a52e39c3545601e3d596655378771ec689200eeda0a0de265cf442490d5e44b6dd
7
- data.tar.gz: 18949fc9dc50a089032465ddf03b293ef4b759d05cd17bcd2a19afa46a86948812cd08fb52aa21b251939bf52ac5bb4f0a047bbd6e49172be6ead5200756d838
6
+ metadata.gz: 1782920ca72bc88963633bf1c628e8a962850b1bf65c3b31401b87545372c47bcbe0f5ebe877e581b7584ba4ae1aafe775d6d270d684f3c9915d43783d73c94c
7
+ data.tar.gz: 39c27c3e838126da3d186e133680c1c917758d20d9aabb1d97bd07c079f0065f516a8d138cd2d5cfe0630e7303f0ee9631d1afd658adfa4e1ac7c0979a290de3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- rabbit_feed (2.4.0)
4
+ rabbit_feed (2.4.1)
5
5
  activemodel (>= 3.2.0, < 5.0.0)
6
6
  activesupport (>= 3.2.0, < 5.0.0)
7
7
  avro (>= 1.5.4, < 1.8.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- rabbit_feed (2.4.0)
4
+ rabbit_feed (2.4.1)
5
5
  activemodel (>= 3.2.0, < 5.0.0)
6
6
  activesupport (>= 3.2.0, < 5.0.0)
7
7
  avro (>= 1.5.4, < 1.8.0)
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
- Airbrake.notify exception
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
@@ -1,3 +1,3 @@
1
1
  module RabbitFeed
2
- VERSION = '2.4.0'
2
+ VERSION = '2.4.1'
3
3
  end
@@ -121,9 +121,20 @@ module RabbitFeed
121
121
  end
122
122
  end
123
123
 
124
- it 'notifies airbrake' do
125
- expect(Airbrake).to receive(:notify).with(an_instance_of RuntimeError)
126
- expect{ subject.consume { raise 'Consuming time' } }.not_to raise_error
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.0
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-08 00:00:00.000000000 Z
11
+ date: 2016-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny