mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-20 22:23:13 +00:00
Don't timeout while waiting for delta
This commit is contained in:
parent
cbde944565
commit
11dfbd1687
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user