diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-25 16:23:31 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-25 16:23:31 +0000 |
commit | b9686126889deafc75fc853e29a68397dc4446b1 (patch) | |
tree | 2c58393f802c6a174ca364962c771d7fb3fdb4ca /src/plugins | |
parent | 4c81a5218361d75b0e06fb79a0578b428eedad87 (diff) | |
download | rspamd-b9686126889deafc75fc853e29a68397dc4446b1.tar.gz rspamd-b9686126889deafc75fc853e29a68397dc4446b1.zip |
[Minor] Add some redis prefixes registration
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/history_redis.lua | 4 | ||||
-rw-r--r-- | 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 |