From 1bf6c17540787f06e71598405cec93c72912407f Mon Sep 17 00:00:00 2001 From: bordun Date: Thu, 25 Jun 2020 00:06:16 +0200 Subject: [PATCH] Revert "server: run electron as node to reduce the number of process in use" This reverts commit 79efa3fdc22ed8f1f409c14cc1012e5e0d2a13ce. --- src/server/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/server/index.js b/src/server/index.js index f94166c3..34384766 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -21,9 +21,11 @@ if (settings.read('docs')) return openDocs() function nodeMode() { + console.warn('(INFO) Running with node') + if (!settings.read('no-gui')) { settings.write('no-gui', true, true) - console.warn('(INFO) Headless mode (--no-gui) enabled automatically (running with node)') + console.warn('(INFO) Headless mode (--no-gui) enabled automatically') } process.on('uncaughtException', (err)=>{ @@ -153,8 +155,8 @@ if (settings.cli) { ipcMain.on('start',function(e, options){ - var args = ['--', '--no-gui'] - // if (process.platform === 'win32') args.unshift('--') // not needed with ELECTRON_RUN_AS_NODE since '--' is always prepended + var args = ['--no-gui'] + if (process.platform === 'win32') args.unshift('--') for (var k in settings.read('options')) { args.push('--' + k) var val = settings.read(k) @@ -165,7 +167,7 @@ if (settings.cli) { } } - global.serverProcess = spawn(process.argv[0], process.argv.slice(1).concat(args), {stdio: 'pipe', env: {'ELECTRON_RUN_AS_NODE':'1'}}) + global.serverProcess = spawn(process.argv[0], process.argv.slice(1).concat(args), {stdio: 'pipe'/*, env: {"ELECTRON_RUN_AS_NODE":"1"}*/}) launcher.webContents.send('server-started') if (!settings.read('no-gui')) {