From a7e9b6af96d27c2225e6981d492f011b6809795e Mon Sep 17 00:00:00 2001 From: simon987 Date: Sat, 15 Apr 2023 13:49:18 -0400 Subject: [PATCH] Flush documents in index --- src/tpool.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tpool.c b/src/tpool.c index 5f3b679..d65f92f 100644 --- a/src/tpool.c +++ b/src/tpool.c @@ -149,6 +149,11 @@ void worker_proc_cleanup(tpool_t *pool) { if (ProcData.index_db != NULL) { database_close(ProcData.index_db, FALSE); } + + if (IndexCtx.needs_es_connection) { + elastic_cleanup(); + } + database_close(ProcData.ipc_db, FALSE); } @@ -242,6 +247,7 @@ static void *tpool_worker(void *arg) { pthread_mutex_lock(&pool->shm->mutex); pthread_cond_signal(&pool->shm->done_working_cond); pthread_mutex_unlock(&pool->shm->mutex); + worker_proc_cleanup(pool); #endif return NULL;