static bool idle_die(void)
{
- return indexer_queue_is_empty(queue);
+ return indexer_queue_is_empty(queue) &&
+ !worker_pool_have_busy_connections(worker_pool);
}
static void client_connected(struct master_service_connection *conn)
i_free(pool);
}
+bool worker_pool_have_busy_connections(struct worker_pool *pool)
+{
+ return pool->busy_list != NULL;
+}
+
static int worker_pool_add_connection(struct worker_pool *pool)
{
struct worker_connection *conn;
worker_pool_init(const char *socket_path, indexer_status_callback_t *callback);
void worker_pool_deinit(struct worker_pool **pool);
+bool worker_pool_have_busy_connections(struct worker_pool *pool);
+
bool worker_pool_get_connection(struct worker_pool *pool,
struct worker_connection **conn_r);
void worker_pool_release_connection(struct worker_pool *pool,