lib/algolia/api/insights_client.rb in algolia-3.8.2 vs lib/algolia/api/insights_client.rb in algolia-3.10.1
- old
+ new
@@ -19,9 +19,21 @@
if region.is_a?(Hash) && (opts.nil? || opts.empty?)
opts = region
region = nil
end
+ if opts.nil? || opts[:connect_timeout].nil?
+ opts[:connect_timeout] = 2000
+ end
+
+ if opts.nil? || opts[:read_timeout].nil?
+ opts[:read_timeout] = 5000
+ end
+
+ if opts.nil? || opts[:write_timeout].nil?
+ opts[:write_timeout] = 30000
+ end
+
if !region.nil? && (!region.is_a?(String) || !regions.include?(region))
raise "`region` must be one of the following: #{regions.join(", ")}"
end
hosts <<