]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not overwrite score occasionally
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 3 Jul 2017 18:22:53 +0000 (19:22 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 3 Jul 2017 18:22:53 +0000 (19:22 +0100)
src/lua/lua_task.c

index b9d8ad56f3eab8837170bb86ff40d97242de3e11..de5e57e7e1c2b9a9ef3cc066ebfd70d6e084c576 100644 (file)
@@ -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 {