mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Cleaned up DB detention scripts
This commit is contained in:
parent
77f7b6a298
commit
189c2bb739
2 changed files with 5 additions and 19 deletions
|
|
@ -816,19 +816,8 @@ end
|
|||
|
||||
-- ########################################################
|
||||
|
||||
local function _harvest_expired_clickhouse_flows(ifname, mysql_retention, verbose)
|
||||
local sql = string.format("ALTER TABLE ntopng.flows DELETE WHERE toUnixTimestamp(FIRST_SEEN) < %u AND INTERFACE_ID = %d", mysql_retention, getInterfaceId(ifname))
|
||||
interface.execSQLQuery(sql)
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
function db_utils.harverstExpiredMySQLFlows(ifname, mysql_retention, verbose)
|
||||
if ntop.isClickHouseEnabled() then
|
||||
-- Clickhouse
|
||||
return _harvest_expired_clickhouse_flows(ifname, mysql_retention, verbose)
|
||||
else
|
||||
-- Plain MySQL
|
||||
if not ntop.isClickHouseEnabled() then
|
||||
return _harvest_expired_mysql_flows(ifname, mysql_retention, verbose)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue