Browse Source

[Minor] Adjust metric score when changing symbol's score

tags/1.7.0
Vsevolod Stakhov 6 years ago
parent
commit
8de4f25c4a
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/lua/lua_task.c

+ 2
- 1
src/lua/lua_task.c View File

@@ -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);

Loading…
Cancel
Save