minor improvement removing 1 coll to time()

improve logging tell which monitor the event belonged to
This commit is contained in:
Isaac Connor 2015-02-06 09:30:48 -05:00
parent 60d92d6a59
commit 856a8ce1d0
1 changed files with 4 additions and 3 deletions

View File

@ -196,10 +196,11 @@ my $last_action = 0;
while( 1 )
{
if ( (time() - $last_action) > $Config{ZM_FILTER_RELOAD_DELAY} )
my $now = time;
if ( ($now - $last_action) > $Config{ZM_FILTER_RELOAD_DELAY} )
{
Debug( "Reloading filters\n" );
$last_action = time();
$last_action = $now;
$filters = getFilters( $filter_parm );
}
@ -632,7 +633,7 @@ sub checkFilter
{
if ( $delete_ok )
{
Info( "Deleting event $event->{Id}\n" );
Info( "Deleting event $event->{Id} from Monitor $event->{MonitorId}\n" );
# Do it individually to avoid locking up the table for new events
my $sql = "delete from Events where Id = ?";
my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );