move test for MIN_AGE up. Don't need to constantly check for it because it won't change.

This commit is contained in:
Isaac Connor 2017-06-02 12:35:01 -04:00
parent 8b91403c25
commit 9c9eaa6851
1 changed files with 5 additions and 5 deletions

View File

@ -111,6 +111,10 @@ if ( ($report + $interactive + $continuous) > 1 ) {
pod2usage(-exitstatus => -1); pod2usage(-exitstatus => -1);
} }
if ( ! exists $Config{ZM_AUDIT_MIN_AGE} ) {
Fatal('ZM_AUDIT_MIN_AGE is not set in config.');
}
my $dbh = zmDbConnect(); my $dbh = zmDbConnect();
chdir( EVENT_PATH ); chdir( EVENT_PATH );
@ -145,12 +149,8 @@ MAIN: while( $loop ) {
sleep 1; sleep 1;
} # end if } # end if
if ( ! exists $Config{ZM_AUDIT_MIN_AGE} ) {
Fatal('ZM_AUDIT_MIN_AGE is not set in config.');
}
my $db_monitors; my $db_monitors;
my $monitorSelectSql = "select Id from Monitors order by Id"; my $monitorSelectSql = 'select Id from Monitors order by Id';
my $monitorSelectSth = $dbh->prepare_cached( $monitorSelectSql ) my $monitorSelectSth = $dbh->prepare_cached( $monitorSelectSql )
or Fatal( "Can't prepare '$monitorSelectSql': ".$dbh->errstr() ); or Fatal( "Can't prepare '$monitorSelectSql': ".$dbh->errstr() );
my $eventSelectSql = 'SELECT Id, (unix_timestamp() - unix_timestamp(StartTime)) as Age my $eventSelectSql = 'SELECT Id, (unix_timestamp() - unix_timestamp(StartTime)) as Age