| 632 | } ia_job; |
| 633 | |
| 634 | static 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 | |
| 656 | static void ia_clear_completed_locked(void) { |
| 657 | if (ia_job.started) |
nothing calls this directly
no test coverage detected