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'
DockerProgress = require 'docker-progress'
Promise = require 'bluebird'
request = Promise.promisifyAll require('request')
{ spawn } = require 'child_process'
progress = require 'request-progress'
config = require './config'
@ -85,13 +84,13 @@ exports.rsyncImageWithProgress = (image, onProgress) ->
else
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 'response', ({statusCode}) -> reject() if statusCode isnt 200
.on 'error', reject
.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 ]
.get(0)