Merge pull request #2455 from balena-io/lucianbuzzo/drop-unused-fn-awaitdevice

Drop unused awaitDevice utility function
This commit is contained in:
bulldozer-balena[bot] 2022-02-10 12:27:25 +00:00 committed by GitHub
commit cc19b00998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -207,35 +207,6 @@ export async function selectOrganization(organizations?: Organization[]) {
}); });
} }
export async function awaitDevice(uuid: string) {
const balena = getBalenaSdk();
const deviceName = await balena.models.device.getName(uuid);
const visuals = getVisuals();
const spinner = new visuals.Spinner(
`Waiting for ${deviceName} to come online`,
);
const poll = async (): Promise<void> => {
const isOnline = await balena.models.device.isOnline(uuid);
if (isOnline) {
spinner.stop();
console.info(`The device **${deviceName}** is online!`);
return;
} else {
// Spinner implementation is smart enough to
// not start again if it was already started
spinner.start();
await delay(3000);
await poll();
}
};
console.info(`Waiting for ${deviceName} to connect to balena...`);
await poll();
return uuid;
}
export async function awaitDeviceOsUpdate( export async function awaitDeviceOsUpdate(
uuid: string, uuid: string,
targetOsVersion: string, targetOsVersion: string,