aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-10 14:34:46 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-10 14:43:39 +0100
commitbffb0bd7a3d3a2fd2a19a805ebb5fb904a66ff24 (patch)
treeb6cfe8cd60b85ab264b1d1b71dd0e95d59951e1f /src/plugins
parent555d0761f792d0bef846e0fa053ad112b6d5853b (diff)
downloadrspamd-bffb0bd7a3d3a2fd2a19a805ebb5fb904a66ff24.tar.gz
rspamd-bffb0bd7a3d3a2fd2a19a805ebb5fb904a66ff24.zip
[Minor] Save settings table in lua cache
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/settings.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index 4562b8361..93e9a56be 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -44,7 +44,9 @@ local function check_query_settings(task)
local parser = ucl.parser()
local res,err = parser:parse_string(tostring(query_set))
if res then
- task:set_settings(parser:get_object())
+ local settings_obj = parser:get_object()
+ task:set_settings(settings_obj)
+ task:cache_set('settings', settings_obj)
return true
else
@@ -72,6 +74,7 @@ local function check_query_settings(task)
end
task:set_settings(nset)
+ task:cache_set('settings', nset)
return true
end
@@ -84,6 +87,7 @@ local function check_query_settings(task)
local elt = settings_ids[id_str]
if elt and elt['apply'] then
task:set_settings(elt['apply'])
+ task:cache_set('settings', elt['apply'])
if elt.apply['add_headers'] or elt.apply['remove_headers'] then
local rep = {
@@ -322,6 +326,7 @@ local function check_settings(task)
task:get_message_id(), s.name)
if rule['apply'] then
task:set_settings(rule['apply'])
+ task:cache_set('settings', rule['apply'])
applied = true
end
if rule['symbols'] then
@@ -617,6 +622,7 @@ local function gen_redis_callback(handler, id)
rspamd_logger.infox(task, "<%1> apply settings according to redis rule %2",
task:get_message_id(), id)
task:set_settings(obj)
+ task:cache_set('settings', obj)
break
end
end