aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-08 11:07:43 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-08 11:07:43 +0100
commit8de4f25c4a3f1337ff3c0efb7ef646bfc4104982 (patch)
tree2c4ab352ce73f9f77e926301104663034682c007
parentdd9783636f3a77e693b778c7617134bb23676fc3 (diff)
downloadrspamd-8de4f25c4a3f1337ff3c0efb7ef646bfc4104982.tar.gz
rspamd-8de4f25c4a3f1337ff3c0efb7ef646bfc4104982.zip
[Minor] Adjust metric score when changing symbol's score
-rw-r--r--src/lua/lua_task.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 12c320b0a..c4f4de3fe 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -1263,7 +1263,6 @@ lua_task_adjust_result (lua_State * L)
const gchar *symbol_name, *param;
struct rspamd_metric_result *metric_res;
struct rspamd_symbol_result *s = NULL;
- struct rspamd_symbol_option *opt;
double weight;
gint i, top;
@@ -1282,7 +1281,9 @@ lua_task_adjust_result (lua_State * L)
}
if (s) {
+ metric_res->score -= s->score;
s->score = weight;
+ metric_res->score += s->score;
}
else {
return luaL_error (L, "symbol not found: %s", symbol_name);