lib/minke/helpers.rb in minke-0.14.0 vs lib/minke/helpers.rb in minke-0.15.0
- old
+ new
@@ -5,11 +5,11 @@
attr_accessor :config
end
@config = nil
- def self.wait_until_server_running server, count
+ def self.wait_until_server_running server, count, successes = 0
begin
response = RestClient.send("get", server)
rescue
end
@@ -19,9 +19,17 @@
sleep 1
if count < 20
self.wait_until_server_running server, count + 1
else
raise 'Server failed to start'
+ end
+ else
+ if successes > 0
+ puts "Server: #{server} passed health check, #{successes} checks to go..."
+ sleep 1
+ self.wait_until_server_running server, count + 1, successes - 1
+ else
+ puts "Server: #{server} healthy"
end
end
end
def self.load_config config_file