aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-10-27 18:19:32 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-10-27 18:19:32 +0300
commitdee3bdecf7b338ded8df307703e2ebf6be209e30 (patch)
tree41ab51dccaa64b5937a6fdba1d18d431bf8c8147 /src/main.c
parent608432786ad77ce7ce071dd975d6c59d503d2302 (diff)
downloadrspamd-dee3bdecf7b338ded8df307703e2ebf6be209e30.tar.gz
rspamd-dee3bdecf7b338ded8df307703e2ebf6be209e30.zip
* Initial implementation of threaded kvstorage worker.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index e470a1e8b..e3e05503d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -30,6 +30,7 @@
#include "smtp.h"
#include "map.h"
#include "fuzzy_storage.h"
+#include "kvstorage_server.h"
#include "cfg_xml.h"
#include "symbols_cache.h"
#include "lua/lua_common.h"
@@ -379,6 +380,12 @@ fork_worker (struct rspamd_main *rspamd, struct worker_conf *cf)
msg_info ("starting greylist storage process %P", getpid ());
start_greylist_storage (cur);
break;
+ case TYPE_KVSTORAGE:
+ setproctitle ("kv storage");
+ rspamd_pidfile_close (rspamd->pfh);
+ msg_info ("starting key-value storage process %P", getpid ());
+ start_kvstorage_worker (cur);
+ break;
case TYPE_WORKER:
default:
setproctitle ("worker process");
@@ -572,6 +579,9 @@ spawn_workers (struct rspamd_main *rspamd)
}
fork_worker (rspamd, cf);
}
+ else if (cf->type == TYPE_KVSTORAGE) {
+ fork_worker (rspamd, cf);
+ }
else {
for (i = 0; i < cf->count; i++) {
fork_worker (rspamd, cf);
@@ -806,6 +816,8 @@ init_workers_ctx (enum process_type type)
return init_fuzzy_storage ();
case TYPE_SMTP:
return init_smtp_worker ();
+ case TYPE_KVSTORAGE:
+ return init_kvstorage_worker ();
default:
return NULL;
}