From 3bd2f530560a1c3eee796ae554d54c59c9e1e19b Mon Sep 17 00:00:00 2001 From: EvSpirit Date: Wed, 25 Mar 2015 20:18:15 +0300 Subject: [PATCH 1/2] #2893 increment --debug-brk port value when forking js-minifier child process --- src/meta/js.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/meta/js.js b/src/meta/js.js index 85188ab3f7..4f575faa41 100644 --- a/src/meta/js.js +++ b/src/meta/js.js @@ -129,7 +129,12 @@ module.exports = function(Meta) { Meta.js.minify = function(minify, callback) { if (nconf.get('isPrimary') === 'true') { - var minifier = Meta.js.minifierProc = fork('minifier.js'), + var forkProcessParams = {}; + if(global.v8debug) { + forkProcessParams = {execArgv: ['--debug-brk=' + (global.process.debugPort + 1)]}; + } + + var minifier = Meta.js.minifierProc = fork('minifier.js', [], forkProcessParams), onComplete = function(err) { if (err) { winston.error('[meta/js] Minification failed: ' + err.message); From 8a6c189d80d15e7c793997906155480cfcf4492b Mon Sep 17 00:00:00 2001 From: EvSpirit Date: Wed, 25 Mar 2015 20:40:42 +0300 Subject: [PATCH 2/2] #2893 increment --debug-brk port value when forking js-minifier child process --- src/meta/js.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/meta/js.js b/src/meta/js.js index 4f575faa41..ff6ef1e32f 100644 --- a/src/meta/js.js +++ b/src/meta/js.js @@ -129,9 +129,21 @@ module.exports = function(Meta) { Meta.js.minify = function(minify, callback) { if (nconf.get('isPrimary') === 'true') { + /** + * Check if the parent process is running with the debug option --debug (or --debug-brk) + */ var forkProcessParams = {}; if(global.v8debug) { - forkProcessParams = {execArgv: ['--debug-brk=' + (global.process.debugPort + 1)]}; + /** + * use the line below if you want to debug minifier.js script too (or even --debug-brk option, but + * you'll have to setup your debugger and connect to the forked process) + */ + //forkProcessParams = {execArgv: ['--debug=' + (global.process.debugPort + 1), '--nolazy']}; + + /** + * otherwise, just clean up --debug/--debug-brk options which are set up by default from the parent one + */ + forkProcessParams = {execArgv: []}; } var minifier = Meta.js.minifierProc = fork('minifier.js', [], forkProcessParams),