aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-10-31 21:35:27 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-10-31 21:35:27 +0000
commita3f746d902aec4215a8d759be8cd43b987fed46a (patch)
treed658069b7e49834679034d80a6d361aa800b2631 /src/plugins
parent1038ed360c95125d6832806c1d58160d1dacb33c (diff)
downloadrspamd-a3f746d902aec4215a8d759be8cd43b987fed46a.tar.gz
rspamd-a3f746d902aec4215a8d759be8cd43b987fed46a.zip
[Minor] Ignore skipped tasks
TODO: write a generic framework for that stuff
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/clickhouse.lua1
-rw-r--r--src/plugins/lua/clustering.lua3
-rw-r--r--src/plugins/lua/elastic.lua2
-rw-r--r--src/plugins/lua/metadata_exporter.lua1
-rw-r--r--src/plugins/lua/neural.lua2
-rw-r--r--src/plugins/lua/ratelimit.lua2
6 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index d95325b24..556de40ef 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -285,6 +285,7 @@ local function clickhouse_send_data(task)
end
local function clickhouse_collect(task)
+ if task:has_flag('skip') then return end
if not settings.allow_local and rspamd_lua_utils.is_rspamc_or_controller(task) then return end
for _,sym in ipairs(settings.stop_symbols) do
diff --git a/src/plugins/lua/clustering.lua b/src/plugins/lua/clustering.lua
index 2711c0658..a5d72fc64 100644
--- a/src/plugins/lua/clustering.lua
+++ b/src/plugins/lua/clustering.lua
@@ -186,6 +186,9 @@ local function clusterting_filter_cb(task, rule)
end
local function clusterting_idempotent_cb(task, rule)
+ if task:has_flag('skip') then return end
+ if not rule.allow_local and lua_util.is_rspamc_or_controller(task) then return end
+
local verdict = lua_util.get_task_verdict(task)
local score
diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua
index 87e01063a..c7f9f392e 100644
--- a/src/plugins/lua/elastic.lua
+++ b/src/plugins/lua/elastic.lua
@@ -208,7 +208,9 @@ end
local function elastic_collect(task)
if not enabled then return end
+ if task:has_flag('skip') then return end
if not settings.allow_local and lua_util.is_rspamc_or_controller(task) then return end
+
local row = {['rspamd_meta'] = get_general_metadata(task),
['@timestamp'] = tostring(util.get_time() * 1000)}
table.insert(rows, row)
diff --git a/src/plugins/lua/metadata_exporter.lua b/src/plugins/lua/metadata_exporter.lua
index 57fe0f105..951142368 100644
--- a/src/plugins/lua/metadata_exporter.lua
+++ b/src/plugins/lua/metadata_exporter.lua
@@ -688,6 +688,7 @@ end
local function gen_exporter(rule)
return function (task)
+ if task:has_flag('skip') then return end
local selector = rule.selector or 'default'
local selected = selectors[selector](task)
if selected then
diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua
index 71ae3afb6..43d7bb127 100644
--- a/src/plugins/lua/neural.lua
+++ b/src/plugins/lua/neural.lua
@@ -904,6 +904,8 @@ local function check_anns(rule, _, ev_base)
end
local function ann_push_vector(task)
+ if task:has_flag('skip') then return end
+ if not settings.allow_local and lua_util.is_rspamc_or_controller(task) then return end
local scores = task:get_metric_score()
for _,rule in pairs(settings.rules) do
local sid = "0"
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua
index 4759d553f..5eddfadba 100644
--- a/src/plugins/lua/ratelimit.lua
+++ b/src/plugins/lua/ratelimit.lua
@@ -622,6 +622,8 @@ local function ratelimit_cb(task)
end
local function ratelimit_update_cb(task)
+ if task:has_flag('skip') then return end
+ if not settings.allow_local and lua_util.is_rspamc_or_controller(task) then return end
local prefixes = task:cache_get('ratelimit_prefixes')
if prefixes then