Set timeout options to the Github::Client

This commit is contained in:
Douglas Barbosa Alexandre 2017-04-24 21:21:58 -03:00
parent 5d106f2597
commit 30794972f4

View file

@ -4,6 +4,8 @@ module Github
def initialize(options) def initialize(options)
@connection = Faraday.new(url: options.fetch(:url)) do |faraday| @connection = Faraday.new(url: options.fetch(:url)) do |faraday|
faraday.options.open_timeout = options.fetch(:timeout, 60)
faraday.options.timeout = options.fetch(:timeout, 60)
faraday.authorization 'token', options.fetch(:token) faraday.authorization 'token', options.fetch(:token)
faraday.adapter :net_http faraday.adapter :net_http
end end