lib/consul/async/vault_endpoint.rb in consul-templaterb-1.31.1 vs lib/consul/async/vault_endpoint.rb in consul-templaterb-1.32.0
- old
+ new
@@ -243,10 +243,10 @@
connection = EventMachine::HttpRequest.new(conf.base_url, options)
cb = proc do |_|
http = connection.send(http_method.downcase, build_request) # Under the hood: c.send('get', {stuff}) === c.get({stuff})
http.callback do
http_result = VaultHttpResponse.new(http.dup.freeze, default_value)
- if enforce_json_200 && http.response_header.status != 200
+ if enforce_json_200 && ![200, 404].include?(http.response_header.status)
_handle_error(http_result) { connection = EventMachine::HttpRequest.new(conf.base_url, options) }
else
@consecutive_errors = 0
modified = @last_result.nil? ? true : @last_result.data != http_result.response # Leaving it do to stats with this later
retry_in = get_lease_duration(http_result) * conf.lease_duration_factor