diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-11 15:12:25 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-11 15:12:25 +0000 |
commit | 4920885f286546ad2fbe225098a3aedeeaddedc1 (patch) | |
tree | 9a133b8872704725a62da191b007b034592a7196 /src | |
parent | 76928b633f9595c425826fa269d0bb6ce9ff693b (diff) | |
download | rspamd-4920885f286546ad2fbe225098a3aedeeaddedc1.tar.gz rspamd-4920885f286546ad2fbe225098a3aedeeaddedc1.zip |
[Minor] Use more portable rounding function
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/bayes_expiry.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/lua/bayes_expiry.lua b/src/plugins/lua/bayes_expiry.lua index 7e6938e67..725a163c7 100644 --- a/src/plugins/lua/bayes_expiry.lua +++ b/src/plugins/lua/bayes_expiry.lua @@ -164,12 +164,12 @@ local expiry_script = [[ local total = ham + spam if ham / total > ${significant_factor} or spam / total > ${significant_factor} then redis.replicate_commands() - redis.call('EXPIRE', key, math.tointeger(KEYS[2])) + redis.call('EXPIRE', key, math.floor(KEYS[2])) extended = extended + 1 elseif math.abs(ham - spam) <= total * ${epsilon_common} then local ttl = redis.call('TTL', key) redis.replicate_commands() - redis.call('EXPIRE', key, math.tointeger(tonumber(ttl) / ${common_ttl_divisor})) + redis.call('EXPIRE', key, math.floor(tonumber(ttl) / ${common_ttl_divisor})) discriminated = discriminated + 1 end end |