hh.ru
instagram.com
linkedin.com
+livejournal.com
mackeeper.com
mercadolibre.com.ar
mercadolivre.com.br
gpointer *ctx; /**< worker's context */
ucl_object_t *options; /**< other worker's options */
struct rspamd_worker_lua_script *scripts; /**< registered lua scripts */
+ gboolean enabled;
ref_entry_t ref;
};
G_STRUCT_OFFSET (struct rspamd_worker_conf, rlimit_maxcore),
RSPAMD_CL_FLAG_INT_32,
"Max size of core file in bytes");
+ rspamd_rcl_add_default_handler (sub,
+ "enabled",
+ rspamd_rcl_parse_struct_boolean,
+ G_STRUCT_OFFSET (struct rspamd_worker_conf, enabled),
+ 0,
+ "Enable or disable a worker (true by default)");
/**
* Modules handler
#endif
c->rlimit_nofile = 0;
c->rlimit_maxcore = 0;
+ c->enabled = TRUE;
REF_INIT_RETAIN (c, rspamd_worker_conf_dtor);
rspamd_mempool_add_destructor (cfg->cfg_pool,
msg_err_main ("type of worker is unspecified, skip spawning");
}
else {
+ if (!cf->enabled) {
+ msg_info_main ("worker of type %s is disabled in the config, "
+ "skip spawning", g_quark_to_string (cf->type));
+ cur = g_list_next (cur);
+
+ continue;
+ }
+
if (cf->worker->flags & RSPAMD_WORKER_ALWAYS_START) {
g_ptr_array_add (seen_mandatory_workers, cf->worker);
}