Don't timeout while waiting for delta

This commit is contained in:
Petros Angelatos 2015-04-30 17:14:16 +00:00 committed by Pablo Carranza Velez
parent cbde944565
commit 11dfbd1687

View File

@ -1,7 +1,6 @@
Docker = require 'dockerode' Docker = require 'dockerode'
DockerProgress = require 'docker-progress' DockerProgress = require 'docker-progress'
Promise = require 'bluebird' Promise = require 'bluebird'
request = Promise.promisifyAll require('request')
{ spawn } = require 'child_process' { spawn } = require 'child_process'
progress = require 'request-progress' progress = require 'request-progress'
config = require './config' config = require './config'
@ -85,13 +84,13 @@ exports.rsyncImageWithProgress = (image, onProgress) ->
else else
resolve() resolve()
progress request.get("#{config.deltaEndpoint}/api/v1/delta?src=#{repoTag}&dest=#{image}") progress request.get("#{config.deltaEndpoint}/api/v1/delta?src=#{repoTag}&dest=#{image}", timeout: 0)
.on 'progress', onProgress .on 'progress', onProgress
.on 'response', ({statusCode}) -> reject() if statusCode isnt 200 .on 'response', ({statusCode}) -> reject() if statusCode isnt 200
.on 'error', reject .on 'error', reject
.pipe rsync.stdin .pipe rsync.stdin
config = request.getAsync("#{config.deltaEndpoint}/api/v1/config?image=#{image}", json: true) config = request.getAsync("#{config.deltaEndpoint}/api/v1/config?image=#{image}", {json: true, timeout: 0})
Promise.all [ config, delta ] Promise.all [ config, delta ]
.get(0) .get(0)