diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-11-04 15:42:15 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-11-04 15:42:15 +0000 |
commit | 70c5a7b68850e825b29b12c672fda71e366f58ff (patch) | |
tree | f100c3558bdf7cbcff45d7156ea5681c4ab4c60a /src/libserver/dynamic_cfg.c | |
parent | cc2301c1517da93dfe0867a5a91bafae18001e1a (diff) | |
download | rspamd-70c5a7b68850e825b29b12c672fda71e366f58ff.tar.gz rspamd-70c5a7b68850e825b29b12c672fda71e366f58ff.zip |
[Rework] Kill metrics!11
Diffstat (limited to 'src/libserver/dynamic_cfg.c')
-rw-r--r-- | src/libserver/dynamic_cfg.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/libserver/dynamic_cfg.c b/src/libserver/dynamic_cfg.c index d576e055a..3f0d490f4 100644 --- a/src/libserver/dynamic_cfg.c +++ b/src/libserver/dynamic_cfg.c @@ -37,7 +37,6 @@ apply_dynamic_conf (const ucl_object_t *top, struct rspamd_config *cfg) gint test_act; const ucl_object_t *cur_elt, *cur_nm, *it_val; ucl_object_iter_t it = NULL; - struct rspamd_metric *real_metric; const gchar *name; gdouble nscore; static const guint priority = 3; @@ -54,12 +53,6 @@ apply_dynamic_conf (const ucl_object_t *top, struct rspamd_config *cfg) "loaded json metric object element has no 'metric' attribute"); continue; } - real_metric = g_hash_table_lookup (cfg->metrics, - ucl_object_tostring (cur_nm)); - if (real_metric == NULL) { - msg_warn ("cannot find metric %s", ucl_object_tostring (cur_nm)); - continue; - } cur_nm = ucl_object_lookup (cur_elt, "symbols"); /* Parse symbols */ @@ -79,7 +72,7 @@ apply_dynamic_conf (const ucl_object_t *top, struct rspamd_config *cfg) /* * We use priority = 3 here */ - rspamd_config_add_metric_symbol (cfg, + rspamd_config_add_symbol (cfg, ucl_object_tostring (n), nscore, NULL, NULL, 0, priority, cfg->default_max_shots); } @@ -114,8 +107,7 @@ apply_dynamic_conf (const ucl_object_t *top, struct rspamd_config *cfg) } nscore = ucl_object_todouble (ucl_object_lookup (it_val, "value")); - rspamd_config_set_action_score (cfg, real_metric->name, - name, nscore, priority); + rspamd_config_set_action_score (cfg, name, nscore, priority); } else { msg_info ( |