Skip to content

Commit

Permalink
device os-update: Refactor to use the overall_progress field
Browse files Browse the repository at this point in the history
Change-type: patch
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
  • Loading branch information
thgreasi committed Apr 21, 2020
1 parent 32b1a7b commit 467324e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 44 deletions.
41 changes: 0 additions & 41 deletions lib/utils/device/progress.ts

This file was deleted.

5 changes: 2 additions & 3 deletions lib/utils/patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ export function awaitDevice(uuid: string) {

export function awaitDeviceOsUpdate(uuid: string, targetOsVersion: string) {
const balena = getBalenaSdk();
const { getDeviceOsProgress } = require('./device/progress');

return balena.models.device.getName(uuid).then(deviceName => {
const visuals = getVisuals();
Expand All @@ -291,8 +290,8 @@ export function awaitDeviceOsUpdate(uuid: string, targetOsVersion: string) {
const poll = (): Bluebird<void> => {
return Bluebird.all([
balena.models.device.getOsUpdateStatus(uuid),
balena.models.device.get(uuid).then(getDeviceOsProgress),
]).then(([osUpdateStatus, osUpdateProgress]) => {
balena.models.device.get(uuid, { $select: 'overall_progress' }),
]).then(([osUpdateStatus, { overall_progress: osUpdateProgress }]) => {
if (osUpdateStatus.status === 'done') {
console.info(
`The device ${deviceName} has been updated to v${targetOsVersion} and will restart shortly!`,
Expand Down

0 comments on commit 467324e

Please sign in to comment.