rspamd_stat_init (worker->srv->cfg, ctx->ev_base);
if (worker->index == 0) {
- rspamd_worker_init_monitored (worker, ctx->ev_base, ctx->resolver);
+ if (!ctx->cfg->disable_monitored) {
+ rspamd_worker_init_monitored (worker, ctx->ev_base, ctx->resolver);
+ }
+
rspamd_map_watch (worker->srv->cfg, ctx->ev_base, ctx->resolver, TRUE);
}
else {
GList *maps; /**< maps active */
gdouble map_timeout; /**< maps watch timeout */
- gdouble map_file_watch_multiplier; /**< multiplier for watch timeout when maps are files */
+ gdouble map_file_watch_multiplier; /**< multiplier for watch timeout when maps are files */
+
+ gdouble monitored_interval; /**< interval between monitored checks */
+ gboolean disable_monitored; /**< disable monitoring completely */
struct symbols_cache *cache; /**< symbols cache object */
gchar *cache_filename; /**< filename of cache file */
G_STRUCT_OFFSET (struct rspamd_config, map_file_watch_multiplier),
0,
"Multiplier for map watch interval when map is file");
+ rspamd_rcl_add_default_handler (sub,
+ "monitoring_watch_interval",
+ rspamd_rcl_parse_struct_time,
+ G_STRUCT_OFFSET (struct rspamd_config, monitored_interval),
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ "Interval for checking monitored instances");
+ rspamd_rcl_add_default_handler (sub,
+ "disable_monitoring",
+ rspamd_rcl_parse_struct_boolean,
+ G_STRUCT_OFFSET (struct rspamd_config, disable_monitored),
+ 0,
+ "Disable monitoring completely");
rspamd_rcl_add_default_handler (sub,
"dynamic_conf",
rspamd_rcl_parse_struct_string,
ctx->change_cb = change_cb;
ctx->ud = ud;
+ if (cfg->monitored_interval != 0) {
+ ctx->monitoring_interval = cfg->monitored_interval;
+ }
+
/* Start all events */
for (i = 0; i < ctx->elts->len; i ++) {
m = g_ptr_array_index (ctx->elts, i);