File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ require("./alias-resolver");
33
44const fs = require ( "node:fs" ) ;
55const path = require ( "node:path" ) ;
6- const Spawn = require ( "node:child_process" ) . spawn ;
6+ const { Worker } = require ( "node:worker_threads" ) ;
77const Log = require ( "logger" ) ;
88
99// global absolute root path
@@ -25,16 +25,16 @@ global.mmTestMode = process.env.mmTestMode === "true";
2525Log . log ( `Starting MagicMirror: v${ global . version } ` ) ;
2626
2727// Log system information in a subprocess so it is shown even on early startup failures.
28- Spawn ( "node . /js/systeminformation.js" , {
28+ const worker = new Worker ( ` ${ global . root_path } /js/systeminformation.js` , {
2929 env : {
3030 ...process . env ,
3131 ELECTRON_VERSION : `${ process . versions . electron } ` ,
3232 USED_NODE_VERSION : `${ process . versions . node } `
33- } ,
34- cwd : this . root_path ,
35- shell : true ,
36- detached : true ,
37- stdio : "inherit"
33+ }
34+ } ) ;
35+
36+ worker . on ( "error" , ( err ) => {
37+ Log . error ( "Systeminformation error:" , err ) ;
3838} ) ;
3939
4040if ( process . env . MM_CONFIG_FILE ) {
You can’t perform that action at this time.
0 commit comments