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

Function prune_grace_s

src/watcher/watcher.c:903–915  ·  view source on GitHub ↗

Sustained-absence window (seconds) before a missing root may be pruned. * Generous default: 10 minutes. Override with CBM_WATCHER_PRUNE_GRACE_S * (>= 0; 0 prunes as soon as the missing-poll streak is reached). Read on * each call so tests/operators can adjust via setenv without a restart — * same convention as cbm_max_file_bytes in limits.c. */

Source from the content-addressed store, hash-verified

901 * each call so tests/operators can adjust via setenv without a restart —
902 * same convention as cbm_max_file_bytes in limits.c. */
903static long prune_grace_s(void) {
904 const char *raw = getenv("CBM_WATCHER_PRUNE_GRACE_S");
905 if (raw && raw[0]) {
906 errno = 0;
907 char *end = NULL;
908 long v = strtol(raw, &end, 10);
909 if (errno == 0 && end != raw && *end == '\0' && v >= 0) {
910 return v;
911 }
912 /* Unparseable / negative → fall through to the safe default. */
913 }
914 return PRUNE_GRACE_DEFAULT_S;
915}
916
917/* Format int to string for logging (poll thread only, one use per call). */
918static const char *itoa_buf(int v) {

Callers 2

prune_missing_projectFunction · 0.85
poll_projectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected