Skip to content

Commit e10c70a

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

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

js/app.js

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

333347
module.exports = new App();

0 commit comments

Comments
 (0)