mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 19:15:03 +00:00
Fix alert update on acknowledge
This commit is contained in:
parent
ce99e80c7e
commit
178c1f8a80
1 changed files with 6 additions and 1 deletions
|
|
@ -634,7 +634,12 @@ function alert_store:acknowledge(label)
|
|||
local where_clause = self:build_where_clause()
|
||||
|
||||
-- Prepare the final query
|
||||
local q = string.format("UPDATE `%s` SET `alert_status` = %u, `user_label` = '%s', `user_label_tstamp` = %u WHERE %s", self._table_name, alert_consts.alert_status.acknowledged.alert_status_id, self:_escape(label), os.time(), where_clause)
|
||||
local q
|
||||
if ntop.isClickHouseEnabled() then
|
||||
q = string.format("ALTER TABLE `%s` UPDATE `alert_status` = %u, `user_label` = '%s', `user_label_tstamp` = %u WHERE %s", self._table_name, alert_consts.alert_status.acknowledged.alert_status_id, self:_escape(label), os.time(), where_clause)
|
||||
else
|
||||
q = string.format("UPDATE `%s` SET `alert_status` = %u, `user_label` = '%s', `user_label_tstamp` = %u WHERE %s", self._table_name, alert_consts.alert_status.acknowledged.alert_status_id, self:_escape(label), os.time(), where_clause)
|
||||
end
|
||||
|
||||
local res = interface.alert_store_query(q)
|
||||
return res and table.len(res) == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue