Exemplo n.º 1
0
static void worker_status_callback(int percentage, void *context)
{
	struct worker_request *request = context;

	if (percentage >= 0 && percentage < 100) {
		indexer_queue_request_status(queue, request->request,
					     percentage);
		return;
	}

	indexer_queue_request_finish(queue, &request->request,
				     percentage == 100);
	if (worker_pool != NULL) /* not in deinit */
		worker_pool_release_connection(worker_pool, request->conn);
	i_free(request);

	/* if this was the last request for the connection, we can send more
	   through it */
	queue_try_send_more(queue);
}
Exemplo n.º 2
0
static void worker_status_callback(int percentage, void *context)
{
	struct worker_request *request = context;

	if (percentage >= 0 && percentage < 100) {
		indexer_queue_request_status(queue, request->request,
					     percentage);
		return;
	}

	indexer_queue_request_finish(queue, &request->request,
				     percentage == 100);
	if (worker_pool != NULL) /* not in deinit */
		worker_pool_release_connection(worker_pool, request->conn);
	i_free(request);

	/* if this was the last request for the connection, we can send more
	   through it. delay it a bit, since we may be coming here from
	   worker_connection_disconnect() and we want to finish it up. */
	if (to_send_more == NULL)
		to_send_more = timeout_add_short(0, queue_try_send_more, queue);
}