aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/redis_scripts/bayes_cache_learn.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lualib/redis_scripts/bayes_cache_learn.lua')
-rw-r--r--lualib/redis_scripts/bayes_cache_learn.lua4
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)