File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,8 +220,11 @@ if (!gotTheLock) {
220220
221221 await initAppState ( ) ;
222222
223+ // Clean up stale daemon sessions from previous app runs
223224 // Must happen BEFORE renderer restore runs
224225 await reconcileDaemonSessions ( ) ;
226+
227+ // Shutdown orphaned daemon if persistence is disabled
225228 await shutdownOrphanedDaemon ( ) ;
226229
227230 try {
Original file line number Diff line number Diff line change @@ -108,6 +108,11 @@ export async function reconcileDaemonSessions(): Promise<void> {
108108 }
109109}
110110
111+ /**
112+ * Shutdown any orphaned daemon process.
113+ * Called on app startup when daemon mode is disabled to clean up
114+ * any daemon left running from a previous session with persistence enabled.
115+ */
111116export async function shutdownOrphanedDaemon ( ) : Promise < void > {
112117 if ( isDaemonModeEnabled ( ) ) {
113118 return ;
You can’t perform that action at this time.
0 commit comments