]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Use %.0f format specifier for floats in clickhouse plugin
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 15 Dec 2025 17:19:01 +0000 (17:19 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 16 Dec 2025 11:34:32 +0000 (11:34 +0000)
Lua 5.4 string.format is stricter than LuaJIT and requires %d to receive
actual integers. Use %.0f for timestamp differences which are floats.

src/plugins/lua/clickhouse.lua

index 2811206b90437a2ba3b65ddb263a864dbc28da14..76586894f778db7b90a5598efbdef2fbae474a1f 100644 (file)
@@ -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