diff options
author | Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> | 2024-10-17 15:35:02 +0200 |
---|---|---|
committer | Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> | 2024-10-17 16:11:25 +0200 |
commit | af7e5e4b3567a93e42e70de33e46e6e67792553a (patch) | |
tree | efd77d3634fa76ea5ff95b02dad468fdaadaf032 /src | |
parent | 202e15b2fad3cabf563474cb9089aa4da41eadf7 (diff) | |
download | rspamd-af7e5e4b3567a93e42e70de33e46e6e67792553a.tar.gz rspamd-af7e5e4b3567a93e42e70de33e46e6e67792553a.zip |
round scores and weight
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/elastic.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua index d4a5fdf85..c1935b1f0 100644 --- a/src/plugins/lua/elastic.lua +++ b/src/plugins/lua/elastic.lua @@ -462,15 +462,21 @@ local function get_general_metadata(task) r.symbols = task:get_symbols_all() for _, symbol in ipairs(r.symbols) do symbol.groups = nil -- we don't need groups array in elastic - if type(symbol.options) == "table" then - symbol.options = table.concat(symbol.options, "; ") + if type(symbol.score) == 'number' then + symbol.score = lua_util.round(symbol.score, 3) + end + if type(symbol.weight) == 'number' then + symbol.weight = lua_util.round(symbol.weight, 3) + end + if type(symbol.options) == 'table' then + symbol.options = table.concat(symbol.options, '; ') end end r.user = user or empty if user then - r.direction = "Outbound" + r.direction = 'Outbound' else - r.direction = "Inbound" + r.direction = 'Inbound' end r.qid = task:get_queue_id() or empty r.helo = task:get_helo() or empty |