From: Vsevolod Stakhov Date: Mon, 15 Dec 2025 17:19:01 +0000 (+0000) Subject: [Fix] Use %.0f format specifier for floats in clickhouse plugin X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90ab45743b7a7d0cf839d95a60cd20fa8317f047;p=thirdparty%2Frspamd.git [Fix] Use %.0f format specifier for floats in clickhouse plugin Lua 5.4 string.format is stricter than LuaJIT and requires %d to receive actual integers. Use %.0f for timestamp differences which are floats. --- diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index 2811206b90..76586894f7 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -1042,8 +1042,8 @@ local function clickhouse_maybe_send_data_periodic(cfg, ev_base, now) if last_collection > 0 and settings.limits.max_interval > 0 then if now - last_collection > settings.limits.max_interval then need_collect = true - reason = string.format('limit of time since last collection has been reached: %d seconds passed ' .. - '(%d seconds trigger)', + reason = string.format('limit of time since last collection has been reached: %.0f seconds passed ' .. + '(%.0f seconds trigger)', (now - last_collection), settings.limits.max_interval) end end