Set a 5 min timeout to delta requests

This commit is contained in:
Petros Angelatos 2015-09-16 12:55:20 +00:00 committed by Pablo Carranza Velez
parent 88f0e4e229
commit 582e3322ec

View File

@ -48,8 +48,8 @@ exports.rsyncImageWithProgress = (imgDest, onProgress) ->
findSimilarImage(imgDest)
.spread (imgSrc) ->
rsyncDiff = new Promise (resolve, reject) ->
console.log("#{config.deltaHost}/api/v1/delta?src=#{imgSrc}&dest=#{imgDest}", timeout: 0)
progress request.get("#{config.deltaHost}/api/v1/delta?src=#{imgSrc}&dest=#{imgDest}", timeout: 0)
console.log("#{config.deltaHost}/api/v1/delta?src=#{imgSrc}&dest=#{imgDest}", timeout: 5 * 60 * 1000)
progress request.get("#{config.deltaHost}/api/v1/delta?src=#{imgSrc}&dest=#{imgDest}", timeout: 5 * 60 * 1000)
.on 'progress', onProgress
.on 'end', ->
onProgress(percent: 100)