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

Function cbm_daemon_client_heartbeat

src/daemon/daemon.c:474–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474bool cbm_daemon_client_heartbeat(cbm_daemon_coordinator_t *coordinator,
475 cbm_daemon_client_id_t client_id, uint64_t now_ms) {
476 if (!coordinator || client_id == CBM_DAEMON_CLIENT_ID_INVALID) {
477 return false;
478 }
479 cbm_mutex_lock(&coordinator->mutex);
480 cbm_daemon_client_t *client = find_client_locked(coordinator, client_id);
481 bool found = client != NULL;
482 if (client && now_ms > client->last_heartbeat_ms) {
483 client->last_heartbeat_ms = now_ms;
484 }
485 cbm_mutex_unlock(&coordinator->mutex);
486 return found;
487}
488
489size_t cbm_daemon_expire_leases(cbm_daemon_coordinator_t *coordinator, uint64_t now_ms) {
490 if (!coordinator) {

Callers 2

test_daemon.cFile · 0.85

Calls 3

cbm_mutex_lockFunction · 0.85
find_client_lockedFunction · 0.85
cbm_mutex_unlockFunction · 0.85

Tested by

no test coverage detected