Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/data-service/node-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Node } from '@prisma/client';
import { IPluginArgs } from '../interfaces/IPluginArgs';
import os from 'os';
import { prisma } from '../prisma';
import { JWT_SECRET } from '../auth/middleware/auth.middleware';
Expand Down
6 changes: 4 additions & 2 deletions src/device-managers/NodeDevices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import log from '../logger';
import { DeviceUpdate } from '../types/DeviceUpdate';
import { IDeviceFilterOptions } from '../interfaces/IDeviceFilterOptions';
import { IDevice } from '../interfaces/IDevice';
import { ATDRepository } from '../data-service/db';

export default class NodeDevices {
private host: string;
Expand Down Expand Up @@ -34,7 +33,10 @@ export default class NodeDevices {
async postDevicesToHub(devices: IDevice[] | DeviceUpdate[], arg: string) {
// DeviceWithPath -> new device
// DeviceUpdate -> removed device
log.info(`Updating remote android devices ${this.host}/device-farm/api/register`);
const [firstDevice] = devices;
log.info(
`Updating remote ${firstDevice.platform} devices ${this.host}/device-farm/api/register`,
);
try {
const status = (
await axios.post(`${this.host}/device-farm/api/register`, devices, {
Expand Down
7 changes: 5 additions & 2 deletions src/device-utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable no-prototype-builtins */
import waitUntil from 'async-wait-until';
import fs from 'fs';
import getPort from 'get-port';
import _ from 'lodash';
import { LocalStorage } from 'node-persist';
import { Container } from 'typedi';
Expand Down Expand Up @@ -92,7 +91,11 @@ export function isDeviceConfigPathAbsolute(path: string): boolean | undefined {
/**
* For given capability, wait untill a free device is available from the database
* and update the capability json with required device informations
* @param requestId
* @param capability
* @param deviceTimeOutMs
* @param deviceQueryIntervalMs
* @param pluginArgs
* @returns
*/
export async function allocateDeviceForSession(
Expand Down Expand Up @@ -429,7 +432,7 @@ export async function refreshSimulatorState(pluginArgs: IPluginArgs, hostPort: n
timer = setInterval(async () => {
const simulators = await new IOSDeviceManager(pluginArgs, hostPort, uuidv4()).getSimulators();
await setSimulatorState(simulators);
}, 10000);
}, pluginArgs.sendNodeDevicesToHubIntervalMs);
}

export async function setupCronCheckStaleDevices(intervalMs: number, currentHost: string) {
Expand Down
Loading