Merge pull request #327 from resin-io/request-progress-2.0.1

Update request-progress to v2.0.1
This commit is contained in:
Pablo Carranza Vélez 2016-10-25 17:47:50 -03:00 committed by GitHub
commit 88e512a69b
3 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,5 @@
* Update request-progress to v2.0.1 [Pablo]
# v2.7.1
* Use multiArgs to promisify gosuper requests [Pablo]

View File

@ -34,7 +34,7 @@
"pinejs-client": "^2.4.0",
"pubnub": "^3.7.13",
"request": "^2.51.0",
"request-progress": "^0.3.1",
"request-progress": "^2.0.1",
"resin-register-device": "^2.0.0",
"rimraf": "^2.5.4",
"rwlock": "^5.0.0",

View File

@ -74,7 +74,8 @@ do ->
new Promise (resolve, reject) ->
progress request.get("#{config.deltaHost}/api/v2/delta?src=#{imgSrc}&dest=#{imgDest}", timeout: DELTA_REQUEST_TIMEOUT)
.on 'progress', (progress) ->
onProgress(percentage: progress.percent)
# In request-progress ^2.0.1, "percentage" is a ratio from 0 to 1
onProgress(percentage: progress.percentage * 100)
.on 'end', ->
onProgress(percentage: 100)
.on 'response', (res) ->