Skip to content

Commit 4abba6f

Browse files
authored
Update heapdumpWorker.js
1 parent 9a8a5cb commit 4abba6f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/heapdumpWorker.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
let fs = require('fs');
2+
let dns = require("dns");
23

34
// set global variables based on args passed on to this heapdump worker
45
let devToolsPort = process.argv[2];
@@ -18,6 +19,12 @@ writeStream.on('error', (err) => {
1819
handleError("Heapdump path not valid or writable", err);
1920
});
2021

22+
try {
23+
dns.setDefaultResultOrder('ipv4first');
24+
} catch (e) {
25+
// ignore, method not available before node16
26+
}
27+
2128
CDP({
2229
host: 'localhost',
2330
port: devToolsPort
@@ -46,4 +53,4 @@ CDP({
4653
});
4754
}).on('error', (err) => {
4855
handleError(err);
49-
});
56+
});

0 commit comments

Comments
 (0)