curl can suspend when the response need more time.
Signed-off-by: Cao Xueliang caoxl78320@163.com --- providers/docker/docker.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/providers/docker/docker.rb b/providers/docker/docker.rb index 51017f3..db0ccee 100755 --- a/providers/docker/docker.rb +++ b/providers/docker/docker.rb @@ -39,15 +39,10 @@ def del_host2queues(hostname) end
def parse_response(url) - response = nil - URI.open(url) do |http| - response = http.read - end + response = %x(curl #{url}) hash = response.is_a?(String) ? JSON.parse(response) : nil if hash.nil? || !hash.key?('job') - puts '..........' - puts 'no job now' - puts '..........' + puts response return nil end return hash