Skip to content
Merged
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
7 changes: 5 additions & 2 deletions src/helpers/deviceId.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { getDeviceId } from "@mongodb-js/device-id";
import * as nodeMachineId from "node-machine-id";
import type { LoggerBase } from "../common/logger.js";
import { LogId } from "../common/logger.js";

Expand All @@ -17,7 +16,11 @@ export class DeviceId {
private constructor(logger: LoggerBase, timeout: number = DEVICE_ID_TIMEOUT) {
this.logger = logger;
this.timeout = timeout;
this.getMachineId = (): Promise<string> => nodeMachineId.machineId(true);
this.getMachineId = async (): Promise<string> => {
const nodeMachineId = await import("node-machine-id");
const machineId = nodeMachineId.default?.machineId || nodeMachineId.machineId;
return machineId(true);
};
this.abortController = new AbortController();

this.deviceIdPromise = DeviceId.UnknownDeviceId;
Expand Down
Loading