mytec: after methods

This commit is contained in:
2026-02-02 01:55:09 +02:00
parent b5b2fd90d2
commit aa07fb5f02
10 changed files with 495 additions and 101 deletions

View File

@@ -279,11 +279,21 @@ function createMainWindow() {
if (!isQuitting) {
event.preventDefault();
isQuitting = true;
gracefulShutdown().then(() => {
app.quit();
}).catch(() => {
// Hard timeout: force exit after 5 seconds no matter what
const forceExitTimer = setTimeout(() => {
log('[CLOSE] Force exit after 5s timeout');
killAllRfcpProcesses();
app.quit();
process.exit(0);
}, 5000);
gracefulShutdown().then(() => {
clearTimeout(forceExitTimer);
app.exit(0);
}).catch(() => {
clearTimeout(forceExitTimer);
killAllRfcpProcesses();
app.exit(0);
});
}
});
@@ -534,11 +544,20 @@ app.on('before-quit', (event) => {
if (!isQuitting) {
event.preventDefault();
isQuitting = true;
gracefulShutdown().then(() => {
app.quit();
}).catch(() => {
const forceExitTimer = setTimeout(() => {
log('[CLOSE] Force exit from before-quit after 5s');
killAllRfcpProcesses();
app.quit();
process.exit(0);
}, 5000);
gracefulShutdown().then(() => {
clearTimeout(forceExitTimer);
app.exit(0);
}).catch(() => {
clearTimeout(forceExitTimer);
killAllRfcpProcesses();
app.exit(0);
});
}
});