From: Vsevolod Stakhov Date: Fri, 3 May 2019 17:36:19 +0000 (+0100) Subject: [Minor] Clickhouse: Add clock skew protection X-Git-Tag: 1.9.3~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4925e97c7de2560141703460fa62c5036bba680f;p=rspamd.git [Minor] Clickhouse: Add clock skew protection --- diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index 8351989e7..da8c736cc 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -576,6 +576,11 @@ local function clickhouse_collect(task) local scan_real,scan_virtual = task:get_scan_time() scan_real,scan_virtual = math.floor(scan_real * 1000), math.floor(scan_virtual * 1000) + if scan_real < 0 then + rspamd_logger.messagex(task, 'clock skew detected for message: %s ms real scan time (reset to 0), %s virtual scan time', + scan_real, scan_virtual) + scan_real = 0 + end local row = { today(timestamp),