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

Function register_watcher_if_enabled

src/mcp/mcp.c:11122–11132  ·  view source on GitHub ↗

Register the session project with the background watcher for ongoing * change detection — unless auto_watch is disabled. */

Source from the content-addressed store, hash-verified

11120/* Register the session project with the background watcher for ongoing
11121 * change detection — unless auto_watch is disabled. */
11122static void register_watcher_if_enabled(cbm_mcp_server_t *srv) {
11123 if (!srv->watcher || srv->session_project[0] == '\0' || srv->session_root[0] == '\0') {
11124 return;
11125 }
11126 if (!auto_watch_enabled(srv)) {
11127 cbm_log_info("watcher.register.skipped", "reason", "auto_watch_off", "project",
11128 srv->session_project);
11129 return;
11130 }
11131 cbm_watcher_watch(srv->watcher, srv->session_project, srv->session_root);
11132}
11133
11134/* Background auto-index thread function */
11135static void *autoindex_thread(void *arg) {

Callers 2

autoindex_threadFunction · 0.85
maybe_auto_indexFunction · 0.85

Calls 2

auto_watch_enabledFunction · 0.85
cbm_watcher_watchFunction · 0.85

Tested by

no test coverage detected