lib/consul/client/agent.rb in consul-ruby-client-0.0.10 vs lib/consul/client/agent.rb in consul-ruby-client-0.0.11
- old
+ new
@@ -109,18 +109,20 @@
case entity
when Consul::Model::HealthCheck
return register_with_backoff(build_check_url('register'), entity.extend(Consul::Model::HealthCheck::Representer), 0, 3)
else
entity = entity.extend(Consul::Model::Service::Representer)
- success = register_with_backoff(build_service_url('register'), entity, 0, 3)
+ success, body = _put build_service_url('register'), entity.to_json
if success
logger.info("Successfully registered service #{entity.name}.")
c = check("service:#{entity.name}") unless entity.check.nil?
unless c.nil?
# Pass the first health check
logger.info("Updating status for health check #{c.check_id} to \"pass\".")
_get build_check_status_url(c.check_id, 'pass')
end
+ else
+ logger.warn("Unable to register #{entity}. Reason: #{body}")
end
return success
end
end