lib/moysklad/client.rb in moysklad-0.3.3 vs lib/moysklad/client.rb in moysklad-0.3.4
- old
+ new
@@ -7,9 +7,10 @@
# URL = 'https://online.moysklad.ru'
URL ='https://online.moysklad.ru/api/remap/1.1/'
def initialize login: nil, password: nil
@client = Faraday.new URL do |conn|
+ conn.options.timeout = ENV.fetch('MOYSKLAD_HTTP_TIMEOUT', 120)
if Faraday::VERSION.split('.').first.to_i < 2
conn.request(:basic_auth, login, password)
else
conn.request(:authorization, :basic, login, password)
end