indexer.c revision 218095792e0af7c1609da4901cfb60e78139595e
/* Copyright (c) 2011-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "restrict-access.h"
#include "process-title.h"
#include "master-service.h"
#include "master-service-settings.h"
#include "indexer-client.h"
#include "indexer-queue.h"
#include "worker-pool.h"
#include "worker-connection.h"
struct worker_request {
struct worker_connection *conn;
struct indexer_request *request;
};
static const struct master_service_settings *set;
static struct indexer_queue *queue;
static struct worker_pool *worker_pool;
void indexer_refresh_proctitle(void)
{
if (!set->verbose_proctitle)
return;
}
static bool idle_die(void)
{
return indexer_queue_is_empty(queue) &&
}
{
}
struct indexer_request *request)
{
struct worker_request *wrequest;
}
{
struct worker_connection *conn;
struct indexer_request *request;
/* there is already a worker handling this user.
it must be the one doing the indexing. use the same
connection for sending this next request. */
} else {
/* try to find an empty worker */
break;
}
}
}
{
}
{
return;
}
percentage == 100);
/* if this was the last request for the connection, we can send more
through it */
}
{
const char *error;
if (master_getopt(master_service) > 0)
return FATAL_DEFAULT;
&error) < 0)
return 0;
}