Fix Dynect job poll bug.
Dynect sometimes gives back HTTP 200 instead of 307. https://github.com/Netflix/denominator/issues/261 We need a workaround for this until it is fixed.
This commit is contained in:
parent
d1a8a64520
commit
db6ca8ac29
|
@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
||||||
## If your rubyforge_project name is different, then edit it and comment out
|
## If your rubyforge_project name is different, then edit it and comment out
|
||||||
## the sub! line in the Rakefile
|
## the sub! line in the Rakefile
|
||||||
s.name = 'fog'
|
s.name = 'fog'
|
||||||
s.version = '1.24.0'
|
s.version = '1.24.1'
|
||||||
s.date = '2014-10-24'
|
s.date = '2014-10-24'
|
||||||
s.rubyforge_project = 'fog'
|
s.rubyforge_project = 'fog'
|
||||||
|
|
||||||
|
|
|
@ -102,8 +102,16 @@ module Fog
|
||||||
raise Error, response.body['msgs'].first['INFO']
|
raise Error, response.body['msgs'].first['INFO']
|
||||||
end
|
end
|
||||||
|
|
||||||
if response.status == 307 && params[:path] !~ %r{^/REST/Job/}
|
if params[:path] !~ %r{^/REST/Job/}
|
||||||
response = poll_job(response, params[:expects], @job_poll_timeout)
|
if response.status == 307
|
||||||
|
response = poll_job(response, params[:expects], @job_poll_timeout)
|
||||||
|
|
||||||
|
# Dynect intermittently returns 200 with an incomplete status. When this
|
||||||
|
# happens, the job should still be polled.
|
||||||
|
elsif response.status == 200 && response.body['status'].eql?('incomplete')
|
||||||
|
response.headers['Location'] = "/REST/Job/#{ response.body['job_id'] }"
|
||||||
|
response = poll_job(response, params[:expects], @job_poll_timeout)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
response
|
response
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
module Fog
|
module Fog
|
||||||
VERSION = '1.24.0'
|
VERSION = '1.24.1'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue