From b9686126889deafc75fc853e29a68397dc4446b1 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 25 Dec 2019 16:23:31 +0000 Subject: [PATCH] [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 -- 2.39.5