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

Function cbm_daemon_client_heartbeat

src/daemon/daemon.c:452–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452bool cbm_daemon_client_heartbeat(cbm_daemon_coordinator_t *coordinator,
453 cbm_daemon_client_id_t client_id, uint64_t now_ms) {
454 if (!coordinator || client_id == CBM_DAEMON_CLIENT_ID_INVALID) {
455 return false;
456 }
457 cbm_mutex_lock(&coordinator->mutex);
458 cbm_daemon_client_t *client = find_client_locked(coordinator, client_id);
459 bool found = client != NULL;
460 if (client && now_ms > client->last_heartbeat_ms) {
461 client->last_heartbeat_ms = now_ms;
462 }
463 cbm_mutex_unlock(&coordinator->mutex);
464 return found;
465}
466
467size_t cbm_daemon_expire_leases(cbm_daemon_coordinator_t *coordinator, uint64_t now_ms) {
468 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