From b3703a5eede0ac451efae60dbb9676fda0aad1bb Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 26 Nov 2018 15:16:10 -0500 Subject: [PATCH] Check in db a second time for the event. Long running zmaudits can find an event in the fs that was created after we loaded all the db events. --- scripts/zmaudit.pl.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index 7a5017fbd..fdb9d68ff 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -454,6 +454,12 @@ MAIN: while( $loop ) { my $Event = $fs_events->{$fs_event_id}; if ( ! defined( $db_events->{$fs_event_id} ) ) { + # Long running zmaudits can find events that were created after we loaded all db events. + # So do a secondary lookup + if ( ZoneMinder::Event->find_one(Id=>$fs_event_id) ) { + Debug("$$Event{Id} found in secondary lookup."); + next; + } my $age = $Event->age(); if ( $age > $Config{ZM_AUDIT_MIN_AGE} ) {