mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-01 19:46:44 +00:00
Merge pull request #326 from resin-io/log-delta-usage
Log whether deltas are being used when downloading an app
This commit is contained in:
commit
3b3d2160b6
@ -1,3 +1,5 @@
|
||||
* Log whether deltas are being used when downloading an app [Pablo]
|
||||
|
||||
# v2.7.0
|
||||
|
||||
* Upgrade docker-progress to v2.3.1 [Pablo]
|
||||
|
@ -36,6 +36,9 @@ logTypes =
|
||||
downloadApp:
|
||||
eventName: 'Application download'
|
||||
humanName: 'Downloading application'
|
||||
downloadAppDelta:
|
||||
eventName: 'Application delta download'
|
||||
humanName: 'Downloading delta for application'
|
||||
downloadAppSuccess:
|
||||
eventName: 'Application downloaded'
|
||||
humanName: 'Downloaded application'
|
||||
@ -182,15 +185,16 @@ fetch = (app, setDeviceUpdateState = true) ->
|
||||
|
||||
docker.getImage(app.imageId).inspectAsync()
|
||||
.catch (error) ->
|
||||
logSystemEvent(logTypes.downloadApp, app)
|
||||
device.updateState(status: 'Downloading', download_progress: 0)
|
||||
|
||||
Promise.try ->
|
||||
conf = JSON.parse(app.config)
|
||||
|
||||
if conf['RESIN_SUPERVISOR_DELTA'] == '1'
|
||||
logSystemEvent(logTypes.downloadAppDelta, app)
|
||||
dockerUtils.rsyncImageWithProgress(app.imageId, onProgress)
|
||||
else
|
||||
logSystemEvent(logTypes.downloadApp, app)
|
||||
dockerUtils.fetchImageWithProgress(app.imageId, onProgress)
|
||||
.then ->
|
||||
logSystemEvent(logTypes.downloadAppSuccess, app)
|
||||
|
Loading…
Reference in New Issue
Block a user