Skip to content

Commit 5268627

Browse files
PetrdontoneЯснецов Петр Андреевич
andauthored
fix: remove duplicate call to send device updates to the hub (#1973)
* chore: Fixed duplicate call to send device updates to the hub * chore: Fixed duplicate call to send device updates to the hub * chore: Fixed duplicate call to send device updates to the hub --------- Co-authored-by: Яснецов Петр Андреевич <[email protected]>
1 parent 95a5304 commit 5268627

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

src/device-managers/IOSDeviceManager.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,6 @@ export default class IOSDeviceManager implements IDeviceManager {
366366
public async getSimulators(): Promise<Array<IDevice>> {
367367
const simulators = await this.fetchLocalSimulators();
368368
simulators.sort((a, b) => (a.state > b.state ? 1 : -1));
369-
370-
// should not be here, but we need to update the hub with simulators
371-
if (this.pluginArgs.hub !== undefined) {
372-
log.info('Updating Hub with Simulators');
373-
const nodeDevices = new NodeDevices(this.pluginArgs.hub);
374-
await nodeDevices.postDevicesToHub(simulators, 'add');
375-
}
376-
377369
return simulators;
378370
}
379371

src/plugin.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { createRouter } from './app';
1010
import commands from './commands/index';
1111
import {
1212
getDevice,
13-
setSimulatorState,
1413
unblockDevice,
1514
unblockDeviceMatchingFilter,
1615
updatedAllocatedDevice,
@@ -23,10 +22,7 @@ import { DeviceFarmManager } from './device-managers';
2322
import ChromeDriverManager from './device-managers/ChromeDriverManager';
2423
import {
2524
allocateDeviceForSession,
26-
deviceType,
2725
initializeStorage,
28-
isIOS,
29-
refreshSimulatorState,
3026
removeStaleDevices,
3127
setupCronCheckStaleDevices,
3228
setupCronCleanPendingSessions,
@@ -276,6 +272,7 @@ class DevicePlugin extends BasePlugin {
276272
DevicePlugin.NODE_ID,
277273
);
278274
await NodeHealthMonitor.getInstance().start(NODE_HEALTH_MONITOR_INTERVAL);
275+
await updateDeviceList(pluginArgs.bindHostOrIp);
279276
log.info(`📣📣📣 I'm a hub and I'm listening on ${pluginArgs.bindHostOrIp}:${cliArgs.port}`);
280277
}
281278

@@ -307,12 +304,6 @@ class DevicePlugin extends BasePlugin {
307304
} else {
308305
log.info('📣📣📣 Cloud runner sessions dont require constant device checks');
309306
}
310-
311-
const devicesUpdates = await updateDeviceList(pluginArgs.bindHostOrIp, hubArgument);
312-
if (isIOS(pluginArgs) && deviceType(pluginArgs, 'simulated')) {
313-
await setSimulatorState(devicesUpdates);
314-
await refreshSimulatorState(pluginArgs, cliArgs.port);
315-
}
316307
log.info(
317308
`📣📣📣 Device Farm Plugin will be served at 🔗 http://${pluginArgs.bindHostOrIp}:${cliArgs.port}/device-farm with id ${DevicePlugin.NODE_ID}`,
318309
);

0 commit comments

Comments
 (0)