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

Function main_version_cohort_close

src/main.c:1309–1339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1307}
1308
1309static bool main_version_cohort_close(cbm_version_cohort_lease_t **lease,
1310 cbm_version_cohort_manager_t **manager) {
1311 bool ok = true;
1312 uint64_t deadline = main_deadline_after(MAIN_COORDINATION_CLEANUP_MS);
1313 while (lease && *lease) {
1314 cbm_private_file_lock_status_t status = cbm_version_cohort_lease_release(lease);
1315 if (status != CBM_PRIVATE_FILE_LOCK_OK) {
1316 ok = false;
1317 }
1318 if (*lease) {
1319 if (cbm_now_ms() >= deadline) {
1320 main_coordination_cleanup_fail_stop("cohort_lease_cleanup");
1321 }
1322 cbm_usleep(1000);
1323 }
1324 }
1325 deadline = main_deadline_after(MAIN_COORDINATION_CLEANUP_MS);
1326 while (manager && *manager) {
1327 cbm_private_file_lock_status_t status = cbm_version_cohort_manager_free(manager);
1328 if (status != CBM_PRIVATE_FILE_LOCK_OK) {
1329 ok = false;
1330 }
1331 if (*manager) {
1332 if (cbm_now_ms() >= deadline) {
1333 main_coordination_cleanup_fail_stop("cohort_manager_cleanup");
1334 }
1335 cbm_usleep(1000);
1336 }
1337 }
1338 return ok;
1339}
1340
1341static bool main_project_lock_manager_close(cbm_project_lock_manager_t **manager) {
1342 bool ok = true;

Callers 1

mainFunction · 0.85

Calls 5

main_deadline_afterFunction · 0.85
cbm_now_msFunction · 0.85

Tested by

no test coverage detected