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.

This commit is contained in:
Isaac Connor 2018-11-26 15:16:10 -05:00
parent 8301f5d039
commit b3703a5eed
1 changed files with 6 additions and 0 deletions

View File

@ -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} ) {