revert to zmMemInvalidate

This commit is contained in:
Isaac Connor 2016-12-23 09:26:38 -05:00
parent 61d3ecf9c1
commit 631c13ab1a
1 changed files with 3 additions and 5 deletions

View File

@ -85,10 +85,6 @@ while( 1 ) {
while( my $monitor = $sth->fetchrow_hashref() ) { while( my $monitor = $sth->fetchrow_hashref() ) {
next if $monitor->{Function} eq 'None'; next if $monitor->{Function} eq 'None';
my $restart = 0; 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 ) if ( zmMemVerify( $monitor )
&& zmMemRead( $monitor, "shared_data:valid" ) && zmMemRead( $monitor, "shared_data:valid" )
) )
@ -98,6 +94,7 @@ while( 1 ) {
if ( !defined($image_time) ) { if ( !defined($image_time) ) {
# Can't read from shared data # Can't read from shared data
Debug( "LastWriteTime is not defined." ); Debug( "LastWriteTime is not defined." );
zmMemInvalidate( $monitor );
next; next;
} }
Debug( "LastWriteTime is = $image_time." ); Debug( "LastWriteTime is = $image_time." );
@ -108,6 +105,7 @@ while( 1 ) {
$restart = 1; $restart = 1;
} else { } else {
# We can't get the last capture time so can't be sure it's died, it might just be starting up. # 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; next;
} }
} }
@ -178,7 +176,7 @@ while( 1 ) {
} # end if restart } # end if restart
} # end if check analysis daemon } # end if check analysis daemon
# Prevent open handles building up if we have connect to shared memory # 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 } # end foreach monitor
sleep( $Config{ZM_WATCH_CHECK_INTERVAL} ); sleep( $Config{ZM_WATCH_CHECK_INTERVAL} );
} # end while (1) } # end while (1)