diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-01-17 15:11:07 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-01-17 15:11:07 +0000 |
commit | a00c667b4ce0ce8d2f2454787854d191f2d5931b (patch) | |
tree | 8cbccc067ef4656c8b69ccea3b8707c9d6243afc /lualib/redis_scripts/bayes_cache_learn.lua | |
parent | da42b91ec31707fac4f9573867401002abbd35c5 (diff) | |
download | rspamd-a00c667b4ce0ce8d2f2454787854d191f2d5931b.tar.gz rspamd-a00c667b4ce0ce8d2f2454787854d191f2d5931b.zip |
[Minor] Remove special handling
Diffstat (limited to 'lualib/redis_scripts/bayes_cache_learn.lua')
-rw-r--r-- | lualib/redis_scripts/bayes_cache_learn.lua | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lualib/redis_scripts/bayes_cache_learn.lua b/lualib/redis_scripts/bayes_cache_learn.lua index 50cfae893..8811f3c33 100644 --- a/lualib/redis_scripts/bayes_cache_learn.lua +++ b/lualib/redis_scripts/bayes_cache_learn.lua @@ -3,12 +3,10 @@ -- key1 - cache id -- key3 - is spam (1 or 0) -- key3 - configuration table in message pack --- key4 - is per user (1 or 0) local cache_id = KEYS[1] local is_spam = KEYS[2] local conf = cmsgpack.unpack(KEYS[3]) -local is_per_user = KEYS[4] == "1" cache_id = string.sub(cache_id, 1, conf.cache_elt_len) -- Try each prefix that is in Redis (as some other instance might have set it) @@ -23,7 +21,7 @@ for i = 0, conf.cache_max_keys do end local added = false -local lim = is_per_user and conf.cache_max_elt * conf.cache_per_user_mult or conf.cache_max_elt +local lim = conf.cache_max_elt for i = 0, conf.cache_max_keys do if not added then local prefix = conf.cache_prefix .. string.rep("X", i) |