From 5dfec9ae61f33003aab026b7147b45beede923b5 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 3 Jul 2017 19:22:53 +0100 Subject: [PATCH] [Minor] Do not overwrite score occasionally --- src/lua/lua_task.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index b9d8ad56f..de5e57e7e 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -3838,7 +3838,13 @@ lua_task_get_metric_action (lua_State *L) if (task) { if ((metric_res = task->result) != NULL) { - action = rspamd_check_action_metric (task, metric_res); + if (task->result->action == METRIC_ACTION_MAX) { + action = rspamd_check_action_metric (task, metric_res); + } + else { + action = task->result->action; + } + lua_pushstring (L, rspamd_action_to_str (action)); } else { -- 2.39.5