diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-12-08 10:48:53 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-12-08 10:48:53 +0000 |
commit | cd568d70852da3d948783060d70bb3de531266e2 (patch) | |
tree | 17d97118918dd4a8fb8aeca7de07fa1e06adcf00 /lualib | |
parent | 6c2f702ab403a74cf3f8738e671289c9bfed6602 (diff) | |
download | rspamd-cd568d70852da3d948783060d70bb3de531266e2.tar.gz rspamd-cd568d70852da3d948783060d70bb3de531266e2.zip |
[Project] Various fixes
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/redis_scripts/bayes_classify.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lualib/redis_scripts/bayes_classify.lua b/lualib/redis_scripts/bayes_classify.lua index 9bef96f14..1a4734cf5 100644 --- a/lualib/redis_scripts/bayes_classify.lua +++ b/lualib/redis_scripts/bayes_classify.lua @@ -7,8 +7,8 @@ local prefix = KEYS[1] local output_spam = {} local output_ham = {} -local learned_ham = redis.call('HGET', prefix, 'learns_ham') or 0 -local learned_spam = redis.call('HGET', prefix, 'learns_spam') or 0 +local learned_ham = tonumber(redis.call('HGET', prefix, 'learns_ham')) or 0 +local learned_spam = tonumber(redis.call('HGET', prefix, 'learns_spam')) or 0 local prefix_underscore = prefix .. '_' -- Output is a set of pairs (token_index, token_count), tokens that are not |