File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11import { getDeviceId } from "@mongodb-js/device-id" ;
2- import * as nodeMachineId from "node-machine-id" ;
32import type { LoggerBase } from "../common/logger.js" ;
43import { LogId } from "../common/logger.js" ;
54
@@ -17,7 +16,11 @@ export class DeviceId {
1716 private constructor ( logger : LoggerBase , timeout : number = DEVICE_ID_TIMEOUT ) {
1817 this . logger = logger ;
1918 this . timeout = timeout ;
20- this . getMachineId = ( ) : Promise < string > => nodeMachineId . machineId ( true ) ;
19+ this . getMachineId = async ( ) : Promise < string > => {
20+ const nodeMachineId = await import ( "node-machine-id" ) ;
21+ const machineId = nodeMachineId . default ?. machineId || nodeMachineId . machineId ;
22+ return machineId ( true ) ;
23+ } ;
2124 this . abortController = new AbortController ( ) ;
2225
2326 this . deviceIdPromise = DeviceId . UnknownDeviceId ;
You can’t perform that action at this time.
0 commit comments