aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/neural.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-25 16:23:31 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-25 16:23:31 +0000
commitb9686126889deafc75fc853e29a68397dc4446b1 (patch)
tree2c58393f802c6a174ca364962c771d7fb3fdb4ca /src/plugins/lua/neural.lua
parent4c81a5218361d75b0e06fb79a0578b428eedad87 (diff)
downloadrspamd-b9686126889deafc75fc853e29a68397dc4446b1.tar.gz
rspamd-b9686126889deafc75fc853e29a68397dc4446b1.zip
[Minor] Add some redis prefixes registration
Diffstat (limited to 'src/plugins/lua/neural.lua')
-rw-r--r--src/plugins/lua/neural.lua24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua
index e64751ef2..2d1d33ec5 100644
--- a/src/plugins/lua/neural.lua
+++ b/src/plugins/lua/neural.lua
@@ -1236,7 +1236,29 @@ local function process_rules_settings()
lua_redis.register_prefix(selt.prefix, N,
string.format('NN prefix for rule "%s"; settings id "%s"',
- rule.prefix, selt.name), {persistent = true})
+ rule.prefix, selt.name), {
+ persistent = true,
+ type = 'zlist',
+ })
+ -- Versions
+ lua_redis.register_prefix(selt.prefix .. '_\\d+', N,
+ string.format('NN storage for rule "%s"; settings id "%s"',
+ rule.prefix, selt.name), {
+ persistent = true,
+ type = 'hash',
+ })
+ lua_redis.register_prefix(selt.prefix .. '_\\d+_spam', N,
+ string.format('NN learning set (spam) for rule "%s"; settings id "%s"',
+ rule.prefix, selt.name), {
+ persistent = true,
+ type = 'list',
+ })
+ lua_redis.register_prefix(selt.prefix .. '_\\d+_ham', N,
+ string.format('NN learning set (spam) for rule "%s"; settings id "%s"',
+ rule.prefix, selt.name), {
+ persistent = true,
+ type = 'list',
+ })
end
for _,rule in pairs(settings.rules) do