graceful shutdown

- confirmation dialog
- shutdown node service
This commit is contained in:
cv
2021-06-04 12:30:36 +02:00
parent ae4363f6f6
commit c5db68fa26
4 changed files with 88 additions and 15 deletions
+10
View File
@@ -195,6 +195,16 @@ ipcMain.on('test-message', (event, arg) => {
// Terminate
ipcMain.on('shutdown', (event, arg) => {
console.log('Got IPC shutdown');
// terminate node service
(async () => {
const { shutdown } = await import(
path.join('file:///', __dirname, env == 'prod' ? '../' : '', 'src/app.js')
);
// Start express server
await shutdown();
})();
win.destroy();
app.quit();
});