mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Prevent possible timestamp-based rrd_update errors from occurring
This commit is contained in:
parent
ebc204b0cc
commit
b365cd28df
1 changed files with 13 additions and 0 deletions
|
|
@ -322,6 +322,19 @@ local function update_rrd(schema, rrdfile, timestamp, data, dont_recover)
|
|||
traceError(TRACE_NORMAL, TRACE_CONSOLE, string.format("Going to update %s [%s]", schema.name, rrdfile))
|
||||
end
|
||||
|
||||
-- Verify last update time
|
||||
local last_update = ntop.rrd_lastupdate(rrdfile)
|
||||
|
||||
if((last_update ~= nil) and (timestamp <= last_update)) then
|
||||
if isDebugEnabled() then
|
||||
traceError(TRACE_NORMAL, TRACE_CONSOLE,
|
||||
string.format("Skip RRD update in the past: timestamp=%u but last_update=%u",
|
||||
timestamp, last_update))
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
for _, metric in ipairs(schema._metrics) do
|
||||
params[#params + 1] = tolongint(data[metric])
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue