diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-08-07 14:52:12 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-08-07 14:52:12 +0100 |
commit | 0e3bc7a86a600b88c57207a0a4442cbe9840d081 (patch) | |
tree | 2168a9dcca6259c6be67870a13d4528c819e7cf0 /src/plugins/lua/reputation.lua | |
parent | b9fb73ce0ba993c9873cf0022be7bb68766c8d83 (diff) | |
download | rspamd-0e3bc7a86a600b88c57207a0a4442cbe9840d081.tar.gz rspamd-0e3bc7a86a600b88c57207a0a4442cbe9840d081.zip |
[Fix] Fix lua schema enrichment logic for Redis params
Diffstat (limited to 'src/plugins/lua/reputation.lua')
-rw-r--r-- | src/plugins/lua/reputation.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/lua/reputation.lua b/src/plugins/lua/reputation.lua index fc7001eb1..a3af26c91 100644 --- a/src/plugins/lua/reputation.lua +++ b/src/plugins/lua/reputation.lua @@ -1089,14 +1089,14 @@ end --]] local backends = { redis = { - schema = lua_redis.generate_schema({ - prefix = ts.string, - expiry = ts.number + ts.string / lua_util.parse_time_interval, + schema = lua_redis.enrich_schema({ + prefix = ts.string:is_optional(), + expiry = (ts.number + ts.string / lua_util.parse_time_interval):is_optional(), buckets = ts.array_of(ts.shape { time = ts.number + ts.string / lua_util.parse_time_interval, name = ts.string, mult = ts.number + ts.string / tonumber - }), + }) :is_optional(), }), config = { expiry = default_expiry, @@ -1263,7 +1263,7 @@ local function parse_rule(name, tbl) rspamd_logger.errx(rspamd_config, "cannot parse whitelist map config for %s: (%s)", sel_type, rule.config.whitelist) - return + return false end end @@ -1362,6 +1362,7 @@ local function parse_rule(name, tbl) } end + return true end redis_params = lua_redis.parse_redis_server('reputation') |