[core] use Excon :persistent option

This commit is contained in:
Brian D. Burns 2013-12-16 17:03:33 -05:00
parent 4c9bcab433
commit 80b4845156
2 changed files with 2 additions and 3 deletions

View File

@ -42,7 +42,7 @@ Gem::Specification.new do |s|
## List your runtime dependencies here. Runtime dependencies are those ## List your runtime dependencies here. Runtime dependencies are those
## that are needed for an end user to actually USE your code. ## that are needed for an end user to actually USE your code.
s.add_dependency('builder') s.add_dependency('builder')
s.add_dependency('excon', '~>0.30.0') s.add_dependency('excon', '~>0.31.0')
s.add_dependency('formatador', '~>0.2.0') s.add_dependency('formatador', '~>0.2.0')
s.add_dependency('multi_json', '~>1.0') s.add_dependency('multi_json', '~>1.0')
s.add_dependency('mime-types') s.add_dependency('mime-types')

View File

@ -30,8 +30,8 @@ module Fog
end end
params[:headers] ||= {} params[:headers] ||= {}
params[:headers]['User-Agent'] ||= "fog/#{Fog::VERSION}" params[:headers]['User-Agent'] ||= "fog/#{Fog::VERSION}"
params.merge!(:persistent => params.fetch(:persistent, persistent))
@excon = Excon.new(url, params) @excon = Excon.new(url, params)
@persistent = persistent
end end
# Makes a request using the connection using Excon # Makes a request using the connection using Excon
@ -53,7 +53,6 @@ module Fog
# @raise [Excon::Errors::SocketError] # @raise [Excon::Errors::SocketError]
# #
def request(params, &block) def request(params, &block)
reset unless @persistent
@excon.request(params, &block) @excon.request(params, &block)
end end