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.
@@ -75,15 +75,18 @@ class RabbitMQ::Cluster
75
75
 
76
76
  def join_cluster
77
77
  if !clustered? && nodes_to_join.any? && up?
78
- `rabbitmqctl stop_app`
78
+ system("rabbitmqctl stop_app")
79
79
  system("rabbitmqctl join_cluster #{nodes_to_join.first}")
80
- `rabbitmqctl start_app`
81
- register if up?
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
@@ -1,5 +1,5 @@
1
1
  module RabbitMQ
2
2
  class Cluster
3
- VERSION = "0.0.16"
3
+ VERSION = "0.0.17"
4
4
  end
5
5
  end
@@ -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
- .with('rabbitmqctl stop_app')
178
- expect(subject).to receive(:"`")
179
- .with('rabbitmqctl start_app')
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.16
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: -3966496825478280473
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: -3966496825478280473
160
+ hash: -1661270494365738817
161
161
  requirements: []
162
162
  rubyforge_project:
163
163
  rubygems_version: 1.8.25