diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-02-10 20:09:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 20:09:03 +0000 |
commit | d4656983a39150844f9aaf7b3ee6cdc8164a4c41 (patch) | |
tree | 87f25c7e7e9f65fa7696cf0066c0a8ff3d518f12 /src | |
parent | 91dd70ca321ddbbb9314752a55325ec008cb0fa9 (diff) | |
parent | ff10dae97e5720fe600420450488d80cc272df0e (diff) | |
download | rspamd-d4656983a39150844f9aaf7b3ee6cdc8164a4c41.tar.gz rspamd-d4656983a39150844f9aaf7b3ee6cdc8164a4c41.zip |
Merge pull request #4074 from citrin/clickhouse
[Fix] ClickHouse cleanup of old partitions
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/clickhouse.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index 7a2e276ee..00a0fc738 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -988,6 +988,10 @@ local function get_last_removal_ago() f:close() end + if last_ts == nil or (last_ts + settings.retention.period) <= current_ts then + return write_ts_to_file() and 0 + end + if last_ts > current_ts then -- Clock skew detected, overwrite last_ts with current_ts and wait for the next -- retention period @@ -996,10 +1000,6 @@ local function get_last_removal_ago() return write_ts_to_file() and -1 end - if last_ts == nil or (last_ts + settings.retention.period) <= current_ts then - return write_ts_to_file() and 0 - end - return (last_ts + settings.retention.period) - current_ts end |