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

Function ia_worker

src/ui/atlas_impact.c:634–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632} ia_job;
633
634static void *ia_worker(void *unused) {
635 (void)unused;
636 cbm_store_t *store = cbm_store_open_path_query(ia_job.db_path);
637 char *json = store ? cbm_atlas_impact_analysis_json(store, ia_job.project, ia_job.file,
638 ia_job.node_id, ia_job.qn)
639 : NULL;
640 if (store)
641 cbm_store_close(store);
642 pthread_mutex_lock(&ia_mu);
643 ia_job.json =
644 json ? json
645 : cbm_mem_strdup(
646 CBM_MEM_CLASS_OTHER,
647 "{\"status\":\"failed\",\"error\":\"Impact snapshot could not be read.\"}");
648 /* Include fallback output before another thread can release the cache. */
649 cbm_mem_class_flush_thread();
650 ia_job.running = false;
651 ia_job.completed = time(NULL);
652 pthread_mutex_unlock(&ia_mu);
653 return NULL;
654}
655
656static void ia_clear_completed_locked(void) {
657 if (ia_job.started)

Callers

nothing calls this directly

Calls 6

cbm_store_closeFunction · 0.85
pthread_mutex_lockFunction · 0.85
cbm_mem_strdupFunction · 0.85

Tested by

no test coverage detected