MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / invalidate_cached_store

Function invalidate_cached_store

src/mcp/mcp.c:7483–7493  ·  view source on GitHub ↗

Drop the cached store so the next query reopens whatever the worker wrote (each * worker is a fresh process that deletes + recreates the .db). NULL-safe: the * background watcher path (main.c) has no MCP server / cached store — the child * writes the DB and the parent only needs the return code, so there is nothing * to invalidate. */

Source from the content-addressed store, hash-verified

7481 * writes the DB and the parent only needs the return code, so there is nothing
7482 * to invalidate. */
7483static void invalidate_cached_store(cbm_mcp_server_t *srv) {
7484 if (!srv) {
7485 return;
7486 }
7487 if (srv->owns_store && srv->store) {
7488 cbm_store_close(srv->store);
7489 srv->store = NULL;
7490 }
7491 free(srv->current_project);
7492 srv->current_project = NULL;
7493}
7494
7495/* Resolve a per-supervisor-run temp path <cache_dir>/logs/.supervisor-<pid><suffix>
7496 * (falls back to the CWD if the cache dir is unresolvable). Used for the crash-

Callers 3

index_run_supervisedFunction · 0.85
open_adr_store_for_writeFunction · 0.85
handle_manage_adrFunction · 0.85

Calls 1

cbm_store_closeFunction · 0.85

Tested by

no test coverage detected