iOSDeviceManager queryDevicesForever converted to async

Summary: ^

Reviewed By: lawrencelomax

Differential Revision: D47912037

fbshipit-source-id: ac7a9650c82219a21577e6bca7e08d075ae5da15
This commit is contained in:
Lorenzo Blasa
2023-07-31 03:55:58 -07:00
committed by Facebook GitHub Bot
parent e9bae419a7
commit f301de64f3

View File

@@ -184,16 +184,15 @@ export class IOSDeviceManager {
}
}
private queryDevicesForever(bridge: IOSBridge) {
return this.queryDevices(bridge)
.then(() => {
// It's important to schedule the next check AFTER the current one has completed
// to avoid simultaneous queries which can cause multiple user input prompts.
setTimeout(() => this.queryDevicesForever(bridge), 3000);
})
.catch((err) => {
console.warn('Failed to continuously query devices:', err);
});
private async queryDevicesForever(bridge: IOSBridge) {
try {
await this.queryDevices(bridge);
// It's important to schedule the next check AFTER the current one has completed
// to avoid simultaneous queries which can cause multiple user input prompts.
setTimeout(() => this.queryDevicesForever(bridge), 3000);
} catch (err) {
console.warn('Failed to continuously query devices:', err);
}
}
async checkXcodeVersionMismatch() {