Skip to content

Commit 6907634

Browse files
committed
fix: restore useful comments
1 parent f70ca2a commit 6907634

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

apps/desktop/src/main/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

apps/desktop/src/main/lib/terminal/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
*/
111116
export async function shutdownOrphanedDaemon(): Promise<void> {
112117
if (isDaemonModeEnabled()) {
113118
return;

0 commit comments

Comments
 (0)