commit b968612: [Minor] Add some redis prefixes registration
Vsevolod Stakhov
vsevolod at highsecure.ru
Wed Dec 25 20:56:06 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-12-25 16:23:31 +0000
URL: https://github.com/rspamd/rspamd/commit/b9686126889deafc75fc853e29a68397dc4446b1
[Minor] Add some redis prefixes registration
---
src/plugins/lua/history_redis.lua | 4 +++-
src/plugins/lua/neural.lua | 24 +++++++++++++++++++++++-
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/plugins/lua/history_redis.lua b/src/plugins/lua/history_redis.lua
index 8a23a75f8..cc26a281e 100644
--- a/src/plugins/lua/history_redis.lua
+++ b/src/plugins/lua/history_redis.lua
@@ -251,7 +251,9 @@ if opts then
priority = 150
})
lua_redis.register_prefix(settings.key_prefix .. hostname, N,
- "Redis history")
+ "Redis history", {
+ type = 'list',
+ })
rspamd_plugins['history'] = {
handler = handle_history_request
}
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
More information about the Commits
mailing list