lib/elasticsearch/transport/transport/base.rb in elasticsearch-transport-2.0.2 vs lib/elasticsearch/transport/transport/base.rb in elasticsearch-transport-5.0.0.pre
- old
+ new
@@ -32,11 +32,10 @@
@state_mutex = Mutex.new
@hosts = arguments[:hosts] || []
@options = arguments[:options] || {}
@options[:http] ||= {}
- @options[:retry_on_status] ||= []
@block = block
@connections = __build_connections
@serializer = options[:serializer] || ( options[:serializer_class] ? options[:serializer_class].new(self) : DEFAULT_SERIALIZER_CLASS.new(self) )
@@ -48,12 +47,12 @@
@sniffer = options[:sniffer_class] ? options[:sniffer_class].new(self) : Sniffer.new(self)
@counter = 0
@counter_mtx = Mutex.new
@last_request_at = Time.now
@reload_connections = options[:reload_connections]
- @reload_after = options[:reload_connections].is_a?(Integer) ? options[:reload_connections] : DEFAULT_RELOAD_AFTER
+ @reload_after = options[:reload_connections].is_a?(Fixnum) ? options[:reload_connections] : DEFAULT_RELOAD_AFTER
@resurrect_after = options[:resurrect_after] || DEFAULT_RESURRECT_AFTER
- @max_retries = options[:retry_on_failure].is_a?(Integer) ? options[:retry_on_failure] : DEFAULT_MAX_RETRIES
+ @max_retries = options[:retry_on_failure].is_a?(Fixnum) ? options[:retry_on_failure] : DEFAULT_MAX_RETRIES
@retry_on_status = Array(options[:retry_on_status]).map { |d| d.to_i }
end
# Returns a connection from the connection pool by delegating to {Connections::Collection#get_connection}.
#