From 22f0d752ea5005bb949fb97dd6e89c6d86ba0b07 Mon Sep 17 00:00:00 2001 From: Paul-Vincent Roll Date: Mon, 28 Mar 2016 13:23:02 +0200 Subject: [PATCH] Start helper_scripts as childs and not just import them into the main script --- js/electron.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/electron.js b/js/electron.js index c61d238c..224c6554 100755 --- a/js/electron.js +++ b/js/electron.js @@ -2,6 +2,7 @@ //for searching modules const walk = require('walk'); +const spawn = require('child_process').spawn; const electron = require('electron'); // Module to control application life. @@ -39,7 +40,8 @@ var module_loader = walk.walk(__dirname + '/../modules', { followLinks: false } module_loader.on('file', function(root, stat, next) { //if file is called node_helper.js load it if (stat.name == "node_helper.js"){ - require(root + '/' + stat.name); + //start module as child + spawn('node', [root + '/' + stat.name]) //Log module name var module = (root + '/' + stat.name).split("/") console.log("Started helper script for module " + module[module.length-2] + ".");