fix(memory): do not close cached manager during doctor status probe

The doctor.memory.status handler was closing the manager in a finally
block, but MemoryIndexManager.get returns a cached instance that may
be the long-lived startup manager with an active file watcher. Closing
it tears down the watcher and disables external-change auto-reindexing.

Remove the close call — manager lifecycle is handled by
closeAllMemorySearchManagers at gateway shutdown.
This commit is contained in:
Jerry-Xin 2026-03-14 22:05:45 +08:00
parent 8ea7bf25a4
commit 7e60248950

View File

@ -56,11 +56,9 @@ export const doctorHandlers: GatewayRequestHandlers = {
};
respond(true, payload, undefined);
} finally {
try {
await manager.close();
} catch {
// Ignore close errors - response already sent
}
// Do NOT close the manager here — it may be the long-lived cached
// instance from startup whose file watcher must stay active.
// Manager lifecycle is handled by closeAllMemorySearchManagers at shutdown.
}
},
};