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. */
| 7614 | * writes the DB and the parent only needs the return code, so there is nothing |
| 7615 | * to invalidate. */ |
| 7616 | static void invalidate_cached_store(cbm_mcp_server_t *srv) { |
| 7617 | if (!srv) { |
| 7618 | return; |
| 7619 | } |
| 7620 | if (srv->owns_store && srv->store) { |
| 7621 | cbm_store_close(srv->store); |
| 7622 | srv->store = NULL; |
| 7623 | } |
| 7624 | free(srv->current_project); |
| 7625 | srv->current_project = NULL; |
| 7626 | } |
| 7627 | |
| 7628 | /* Resolve a per-supervisor-run temp path <cache_dir>/logs/.supervisor-<pid><suffix> |
| 7629 | * (falls back to the CWD if the cache dir is unresolvable). Used for the crash- |
no test coverage detected