Skip to content

Commit

Permalink
iOSDeviceManager queryDevicesForever converted to async
Browse files Browse the repository at this point in the history
Summary: ^

Reviewed By: lawrencelomax

Differential Revision: D47912037

fbshipit-source-id: ac7a9650c82219a21577e6bca7e08d075ae5da15
  • Loading branch information
lblasa authored and facebook-github-bot committed Jul 31, 2023
1 parent e9bae41 commit f301de6
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit f301de6

Please sign in to comment.