lib/consul/async/consul_template.rb in consul-templaterb-1.13.1 vs lib/consul/async/consul_template.rb in consul-templaterb-1.14.0
- old
+ new
@@ -220,13 +220,17 @@
else
not_ready << endpt.endpoint.path
end
to_cleanup << endpoint_key if (@iteration - endpt.seen_at) > 60
end
- if not_ready.count.positive?
+ if not_ready.count.positive? || data.nil?
if @iteration - @last_debug_time > 1
@last_debug_time = @iteration
- ::Consul::Async::Debug.print_info "Waiting for data from #{not_ready.count}/#{not_ready.count + ready} endpoints: #{not_ready[0..2]}...\r"
+ if data.nil?
+ ::Consul::Async::Debug.print_info "Waiting for Template #{tpl_file_path} to not return nil, consider it not ready...\r"
+ else
+ ::Consul::Async::Debug.print_info "Waiting for data from #{not_ready.count}/#{not_ready.count + ready} endpoints: #{not_ready[0..2]}...\r"
+ end
end
return [false, false, nil]
end
if to_cleanup.count > 1
::Consul::Async::Debug.puts_info "Cleaned up #{to_cleanup.count} endpoints: #{to_cleanup}"