rabbitmq-cluster 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rabbitmq/cluster/server.rb +6 -3
- data/lib/rabbitmq/cluster/version.rb +1 -1
- data/spec/unit/server_spec.rb +4 -5
- metadata +3 -3
@@ -75,15 +75,18 @@ class RabbitMQ::Cluster
|
|
75
75
|
|
76
76
|
def join_cluster
|
77
77
|
if !clustered? && nodes_to_join.any? && up?
|
78
|
-
|
78
|
+
system("rabbitmqctl stop_app")
|
79
79
|
system("rabbitmqctl join_cluster #{nodes_to_join.first}")
|
80
|
-
|
81
|
-
|
80
|
+
system("rabbitmqctl start_app")
|
81
|
+
sleep 1 until up?
|
82
|
+
register
|
82
83
|
end
|
83
84
|
end
|
84
85
|
|
85
86
|
def clustered?
|
86
87
|
client.nodes.size > 1
|
88
|
+
rescue Faraday::ConnectionFailed
|
89
|
+
false
|
87
90
|
end
|
88
91
|
|
89
92
|
def nodes_to_join
|
data/spec/unit/server_spec.rb
CHANGED
@@ -161,7 +161,6 @@ describe RabbitMQ::Cluster::Server do
|
|
161
161
|
end
|
162
162
|
|
163
163
|
it 'does nothing' do
|
164
|
-
expect(subject).to_not receive(:"`")
|
165
164
|
expect(subject).to_not receive(:system)
|
166
165
|
subject.synchronize
|
167
166
|
end
|
@@ -173,10 +172,10 @@ describe RabbitMQ::Cluster::Server do
|
|
173
172
|
end
|
174
173
|
|
175
174
|
it 'stops the management app before clustering' do
|
176
|
-
expect(subject).to receive(:
|
177
|
-
|
178
|
-
expect(subject).to receive(:
|
179
|
-
|
175
|
+
expect(subject).to receive(:system)
|
176
|
+
.with('rabbitmqctl stop_app')
|
177
|
+
expect(subject).to receive(:system)
|
178
|
+
.with('rabbitmqctl start_app')
|
180
179
|
subject.synchronize
|
181
180
|
end
|
182
181
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbitmq-cluster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -148,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
148
|
version: '0'
|
149
149
|
segments:
|
150
150
|
- 0
|
151
|
-
hash: -
|
151
|
+
hash: -1661270494365738817
|
152
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
153
|
none: false
|
154
154
|
requirements:
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
version: '0'
|
158
158
|
segments:
|
159
159
|
- 0
|
160
|
-
hash: -
|
160
|
+
hash: -1661270494365738817
|
161
161
|
requirements: []
|
162
162
|
rubyforge_project:
|
163
163
|
rubygems_version: 1.8.25
|