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

Function main_startup_timeout_ms

src/main.c:87–100  ·  view source on GitHub ↗

Daemon startup budget, overridable for loaded hosts: a fixed 30 s races * whatever else the machine is doing (parallel test waves, CI legs), and a * cold daemon on a starved host loses through no fault of its own. * CBM_STARTUP_TIMEOUT_MS, clamped to [1s, 10min]; malformed -> default. */

Source from the content-addressed store, hash-verified

85 * cold daemon on a starved host loses through no fault of its own.
86 * CBM_STARTUP_TIMEOUT_MS, clamped to [1s, 10min]; malformed -> default. */
87static uint32_t main_startup_timeout_ms(void) {
88 const char *raw = cbm_runtime_getenv("CBM_STARTUP_TIMEOUT_MS");
89 if (!raw || !raw[0])
90 return MAIN_MCP_STARTUP_TIMEOUT_MS;
91 char *end = NULL;
92 long value = strtol(raw, &end, 10);
93 if (!end || *end != '\0' || value <= 0)
94 return MAIN_MCP_STARTUP_TIMEOUT_MS;
95 if (value < MAIN_STARTUP_TIMEOUT_MIN_MS)
96 return MAIN_STARTUP_TIMEOUT_MIN_MS;
97 if (value > MAIN_STARTUP_TIMEOUT_MAX_MS)
98 return MAIN_STARTUP_TIMEOUT_MAX_MS;
99 return (uint32_t)value;
100}
101#define SLEN(s) (sizeof(s) - 1)
102#include "foundation/log.h"
103#include "foundation/diagnostics.h"

Callers 3

mainFunction · 0.85

Calls 1

cbm_runtime_getenvFunction · 0.85

Tested by

no test coverage detected