From 631c13ab1a14a44be2c17df178b1a819843c8900 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 23 Dec 2016 09:26:38 -0500 Subject: [PATCH] revert to zmMemInvalidate --- scripts/zmwatch.pl.in | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/zmwatch.pl.in b/scripts/zmwatch.pl.in index bb0bd1e88..77d59dc86 100644 --- a/scripts/zmwatch.pl.in +++ b/scripts/zmwatch.pl.in @@ -85,10 +85,6 @@ while( 1 ) { while( my $monitor = $sth->fetchrow_hashref() ) { next if $monitor->{Function} eq 'None'; my $restart = 0; - # Prevent open handles building up if we have connect to shared memory - # Many of our error checks below do a next without closing the mem handle. - # zmMemDetach will just return of nothing is open, so we can just do this here. - zmMemDetach( $monitor ); if ( zmMemVerify( $monitor ) && zmMemRead( $monitor, "shared_data:valid" ) ) @@ -98,6 +94,7 @@ while( 1 ) { if ( !defined($image_time) ) { # Can't read from shared data Debug( "LastWriteTime is not defined." ); + zmMemInvalidate( $monitor ); next; } Debug( "LastWriteTime is = $image_time." ); @@ -108,6 +105,7 @@ while( 1 ) { $restart = 1; } else { # We can't get the last capture time so can't be sure it's died, it might just be starting up. + zmMemInvalidate( $monitor ); next; } } @@ -178,7 +176,7 @@ while( 1 ) { } # end if restart } # end if check analysis daemon # Prevent open handles building up if we have connect to shared memory - zmMemDetach( $monitor ); # Close our file handle to the zmc process we are about to end + zmMemInvalidate( $monitor ); # Close our file handle to the zmc process we are about to end } # end foreach monitor sleep( $Config{ZM_WATCH_CHECK_INTERVAL} ); } # end while (1)