From: Vsevolod Stakhov Date: Sun, 7 Dec 2025 15:00:05 +0000 (+0000) Subject: [Fix] Fix other places of 5.4 rounding issues X-Git-Tag: 3.14.2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f8dd02cab1ef4e1a72030fef1f219d635608f23;p=thirdparty%2Frspamd.git [Fix] Fix other places of 5.4 rounding issues --- diff --git a/lualib/llm_context.lua b/lualib/llm_context.lua index 7973e9e1d2..276a3d8340 100644 --- a/lualib/llm_context.lua +++ b/lualib/llm_context.lua @@ -518,7 +518,7 @@ function M.update_after_classification(task, redis_params, opts, result, sel_par end end local ok = lua_redis.redis_make_request(task, redis_params, ident.key, true, on_set, 'SETEX', - { ident.key, tostring(ttl), payload }) + { ident.key, tostring(math.floor(ttl)), payload }) if not ok then rspamd_logger.errx(task, 'llm_context: set request was not scheduled') end diff --git a/lualib/lua_stat.lua b/lualib/lua_stat.lua index a0f3303ad6..c8ecb17278 100644 --- a/lualib/lua_stat.lua +++ b/lualib/lua_stat.lua @@ -249,7 +249,7 @@ end conn:add_cmd('HINCRBYFLOAT', { rkey, hash_key, tostring(tok[2]) }) if expire and expire ~= 0 then - conn:add_cmd('EXPIRE', { rkey, tostring(expire) }) + conn:add_cmd('EXPIRE', { rkey, tostring(math.floor(expire)) }) end end diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua index 4d61f9771f..8d9859f8a9 100644 --- a/src/plugins/lua/neural.lua +++ b/src/plugins/lua/neural.lua @@ -507,7 +507,7 @@ local function do_train_ann(worker, ev_base, rule, set, ann_key) { ann_key, tostring(os.time()), - tostring(math.max(10.0, rule.watch_interval * 2)), + tostring(math.floor(math.max(10.0, rule.watch_interval * 2))), rspamd_util.get_hostname() }) end diff --git a/src/plugins/lua/url_redirector.lua b/src/plugins/lua/url_redirector.lua index 1e5bc137c0..f60d3bd08b 100644 --- a/src/plugins/lua/url_redirector.lua +++ b/src/plugins/lua/url_redirector.lua @@ -345,7 +345,7 @@ local function resolve_cached(task, orig_url, url, key, ntries) true, -- is write redis_reserve_cb, --callback 'SET', -- command - { key, 'processing', 'EX', tostring(settings.timeout * 2), 'NX' } -- arguments + { key, 'processing', 'EX', tostring(math.floor(settings.timeout * 2)), 'NX' } -- arguments ) if not ret then rspamd_logger.errx(task, 'Couldn\'t schedule SET')