| 788 | } |
| 789 | |
| 790 | void cbm_index_worker_destroy(cbm_index_worker_handle_t *handle) { |
| 791 | if (!handle) { |
| 792 | return; |
| 793 | } |
| 794 | if (!atomic_load_explicit(&handle->terminal, memory_order_acquire)) { |
| 795 | cbm_log_error("index.supervisor.destroy_running", "action", "ignored"); |
| 796 | return; |
| 797 | } |
| 798 | cbm_subprocess_destroy(handle->process); |
| 799 | free(handle->result.response); |
| 800 | handle->result.response = NULL; |
| 801 | free(handle); |
| 802 | } |
| 803 | |
| 804 | int cbm_index_spawn_worker_with_log_cancel(const char *args_json, bool single_thread, |
| 805 | const char *marker_file, const char *quarantine_file, |