cluster: properly handle --inspect-{brk,port}
PR-URL: https://github.com/nodejs/node/pull/11386 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Josh Gavant <josh.gavant@outlook.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
c090ca8160
commit
389b9e484d
@ -115,7 +115,7 @@ function createWorkerProcess(id, env) {
|
||||
|
||||
for (var i = 0; i < execArgv.length; i++) {
|
||||
const match = execArgv[i].match(
|
||||
/^(--inspect|--debug|--debug-(brk|port))(=\d+)?$/
|
||||
/^(--inspect|--inspect-(brk|port)|--debug|--debug-(brk|port))(=\d+)?$/
|
||||
);
|
||||
|
||||
if (match) {
|
||||
|
@ -27,6 +27,8 @@ if (cluster.isMaster) {
|
||||
fork(4, ['--inspect', '--debug']);
|
||||
fork(5, [`--debug=${debuggerPort}`, '--inspect']);
|
||||
fork(6, ['--inspect', `--debug-port=${debuggerPort}`]);
|
||||
fork(7, [`--inspect-port=${debuggerPort}`]);
|
||||
fork(8, ['--inspect', `--inspect-port=${debuggerPort}`]);
|
||||
} else {
|
||||
const hasDebugArg = process.execArgv.some(function(arg) {
|
||||
return /inspect/.test(arg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user