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

const gchar *symbol_name, *param; const gchar *symbol_name, *param;
struct rspamd_metric_result *metric_res; struct rspamd_metric_result *metric_res;
struct rspamd_symbol_result *s = NULL; struct rspamd_symbol_result *s = NULL;
struct rspamd_symbol_option *opt;
double weight; double weight;
gint i, top; gint i, top;


} }


if (s) { if (s) {
metric_res->score -= s->score;
s->score = weight; s->score = weight;
metric_res->score += s->score;
} }
else { else {
return luaL_error (L, "symbol not found: %s", symbol_name); return luaL_error (L, "symbol not found: %s", symbol_name);

Loading…
Cancel
Save