diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-08-03 17:06:27 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-08-07 13:06:13 -0300 |
commit | cb08cb22188ef1e14ea6d4570586056495614e79 (patch) | |
tree | 59259de6787e83f2c48708fef768507358f45f59 /lib | |
parent | 6f642e3f7bf4667dad6efeb5e43f79b9711bc204 (diff) | |
download | gitlab-ce-cb08cb22188ef1e14ea6d4570586056495614e79.tar.gz |
Extrac common timeout to a constant on Github::Client
Diffstat (limited to 'lib')
-rw-r--r-- | lib/github/client.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/github/client.rb b/lib/github/client.rb index 0102406fd20..7d77f1a91bc 100644 --- a/lib/github/client.rb +++ b/lib/github/client.rb @@ -1,11 +1,13 @@ module Github class Client + TIMEOUT = 60 + attr_reader :connection, :rate_limit def initialize(options) @connection = Faraday.new(url: options.fetch(:url, root_endpoint)) do |faraday| - faraday.options.open_timeout = options.fetch(:timeout, 60) - faraday.options.timeout = options.fetch(:timeout, 60) + faraday.options.open_timeout = options.fetch(:timeout, TIMEOUT) + faraday.options.timeout = options.fetch(:timeout, TIMEOUT) faraday.authorization 'token', options.fetch(:token) faraday.adapter :net_http end |