From e10c70a2999600c0caf5996c73cdf773edd860c9 Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Mon, 18 May 2026 00:20:33 +0200 Subject: [PATCH] delay ending main process so systeminformation child process can log without hanging shell --- js/app.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/app.js b/js/app.js index f37047fb76..e2089170ff 100644 --- a/js/app.js +++ b/js/app.js @@ -328,6 +328,20 @@ function App () { await this.stop(); process.exit(0); }); + + /** + * + * @param {number} ms milliseconds to wait + */ + function blockingSleep (ms) { + const int32 = new Int32Array(new SharedArrayBuffer(4)); + Atomics.wait(int32, 0, 0, ms); + } + + process.on("exit", () => { + // wait before exiting so that child processes (e.g. systeminformation) have some additional time + blockingSleep(1000); + }); } module.exports = new App();