Skip to content

Commit 26d9cf9

Browse files
committed
delay ending main process so systeminformation child process can log without hanging shell
1 parent 13d51cf commit 26d9cf9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

js/app.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,16 @@ function App () {
328328
await this.stop();
329329
process.exit(0);
330330
});
331+
332+
function blockingSleep(ms) {
333+
const int32 = new Int32Array(new SharedArrayBuffer(4));
334+
Atomics.wait(int32, 0, 0, ms);
335+
};
336+
337+
process.on("exit", () => {
338+
// wait before exiting so that child processes (e.g. systeminformation) have some additional time
339+
blockingSleep(1000);
340+
});
331341
}
332342

333343
module.exports = new App();

0 commit comments

Comments
 (0)