multiple_man 1.3.0 → 1.4.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 546b5d63fbc985f621b1b5c891aa7cdbc93bab8b
|
4
|
+
data.tar.gz: 0201b5a619231469deb7dc5213be502dda2c0fe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 175d5be3b1a35cc18447d0be840d6a7615f5992f62650d62a054eed9288201629bf6646b8e257fc5bcd1549cf2ddc19cba7a17accb7d9b283679358e301b1bae
|
7
|
+
data.tar.gz: 230e1bedf174de89182ab379e4e1ec93b1f1d8863bd42b214dbd43d23001337d815a03b0276bd97a3220beb12c570cb8bead859d2a1a4361e335579cc4625d1f
|
@@ -9,9 +9,9 @@ module MultipleMan
|
|
9
9
|
loop do
|
10
10
|
channel = queue.pop
|
11
11
|
begin
|
12
|
-
channel.close unless closed?
|
12
|
+
channel.close unless channel.closed?
|
13
13
|
puts "Channel #{channel.number} closed!"
|
14
|
-
rescue Exception
|
14
|
+
rescue Bunny::Exception, Timeout::Error
|
15
15
|
sleep config.connection_recovery[:time_between_retries]
|
16
16
|
retry
|
17
17
|
end
|
data/lib/multiple_man/version.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MultipleMan::ChannelMaintenance::Reaper do
|
4
|
+
let(:mock_channel) { double(Bunny::Channel, close: nil, closed?: false, number: 1) }
|
5
|
+
let(:mock_queue) { double(Queue, pop: mock_channel) }
|
6
|
+
let(:mock_config_hash) { { time_between_retries: 1 } }
|
7
|
+
let(:mock_mm_config) { double(MultipleMan, connection_recovery: mock_config_hash) }
|
8
|
+
|
9
|
+
before do
|
10
|
+
expect(Queue).to receive(:new).and_return(mock_queue)
|
11
|
+
expect(Thread).to receive(:new).and_yield
|
12
|
+
expect_any_instance_of(
|
13
|
+
MultipleMan::ChannelMaintenance::Reaper
|
14
|
+
).to receive(:loop).and_yield
|
15
|
+
end
|
16
|
+
|
17
|
+
it "reaps an open connection" do
|
18
|
+
expect(mock_channel).to receive(:close)
|
19
|
+
|
20
|
+
described_class.new(mock_mm_config)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "raises errors" do
|
24
|
+
expect(mock_channel).to receive(:closed?).and_raise(NoMethodError)
|
25
|
+
|
26
|
+
expect { described_class.new(mock_mm_config) }.to raise_error(NoMethodError)
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multiple_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Brunner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- lib/multiple_man/version.rb
|
139
139
|
- multiple_man.gemspec
|
140
140
|
- spec/attribute_extractor_spec.rb
|
141
|
+
- spec/channel_maintenance/reaper_spec.rb
|
141
142
|
- spec/connection_spec.rb
|
142
143
|
- spec/consumers/general_spec.rb
|
143
144
|
- spec/consumers/seed_spec.rb
|
@@ -176,12 +177,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
177
|
version: '0'
|
177
178
|
requirements: []
|
178
179
|
rubyforge_project:
|
179
|
-
rubygems_version: 2.5.
|
180
|
+
rubygems_version: 2.5.2
|
180
181
|
signing_key:
|
181
182
|
specification_version: 4
|
182
183
|
summary: MultipleMan syncs changes to ActiveRecord models via AMQP
|
183
184
|
test_files:
|
184
185
|
- spec/attribute_extractor_spec.rb
|
186
|
+
- spec/channel_maintenance/reaper_spec.rb
|
185
187
|
- spec/connection_spec.rb
|
186
188
|
- spec/consumers/general_spec.rb
|
187
189
|
- spec/consumers/seed_spec.rb
|