Improved error handling.

This commit is contained in:
Martin Edenhofer 2014-12-26 00:42:59 +01:00
parent c033edcc6e
commit 7870d501f7

View file

@ -240,7 +240,7 @@ return true if backend is configured
end end
def self.connection( url ) def self.connection( url )
conn = Faraday.new( :url => url ) conn = Faraday.new( :url => url, :options => { :open_timeout => 5, :timeout => 10 } )
user = Setting.get('es_user') user = Setting.get('es_user')
pw = Setting.get('es_password') pw = Setting.get('es_password')
if user && !user.empty? && pw && !pw.empty? if user && !user.empty? && pw && !pw.empty?