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

Function worker_quiet_timeout_ms

src/mcp/index_supervisor.c:95–105  ·  view source on GitHub ↗

Quiet-timeout (ms) for a supervised worker: killed + reported as a hang if it * emits no NEW log line within the window. This is a NO-PROGRESS timeout — every * completed log line the worker tails (per-batch parallel.extract.progress every * 10 files, plus each pass boundary) resets it — NOT a total-time cap, so a large * repo that keeps making progress is never falsely killed. Default: 15 min

Source from the content-addressed store, hash-verified

93 * genuinely stuck file emits nothing, so this fires only on a real hang). The
94 * CBM_INDEX_WORKER_TIMEOUT_S override (seconds → ms) tightens it for tests. */
95static int worker_quiet_timeout_ms(void) {
96 enum { DEFAULT_QUIET_TIMEOUT_MS = 900000 }; /* 15 min with no progress */
97 const char *e = getenv("CBM_INDEX_WORKER_TIMEOUT_S");
98 if (e && e[0]) {
99 long s = atol(e);
100 if (s > 0) {
101 return (int)(s * 1000);
102 }
103 }
104 return DEFAULT_QUIET_TIMEOUT_MS;
105}
106
107/* Read an entire file into a heap string (NUL-terminated). NULL on error. */
108static char *slurp_file(const char *path) {

Callers 1

cbm_index_spawn_workerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected