Improve exit handling when already shutting down

This commit is contained in:
2026-05-06 06:02:56 +02:00
parent 17ab1fc236
commit 0f0a82b798

View File

@@ -141,9 +141,15 @@ async function launchTauri() {
})
tauriProcess.on('exit', (code, signal) => {
const wasShuttingDown = shuttingDown
shuttingDown = true
stopSpawnedBackend()
if (wasShuttingDown) {
process.exit(0)
return
}
if (signal) {
process.exit(signal === 'SIGINT' || signal === 'SIGTERM' ? 0 : 1)
return