From 509cecf9f580492de5fba2ed0d20482624efcc2a Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 25 Oct 2021 16:52:20 -0400 Subject: [PATCH] Skip image checking capturing==Ondemand --- scripts/zmwatch.pl.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/zmwatch.pl.in b/scripts/zmwatch.pl.in index 96235ccd3..e04e41d30 100644 --- a/scripts/zmwatch.pl.in +++ b/scripts/zmwatch.pl.in @@ -85,20 +85,22 @@ my $sth = $dbh->prepare_cached($sql) or Fatal("Can't prepare '$sql': ".$dbh->errstr()); while (!$zm_terminate) { - while ( ! ( $dbh and $dbh->ping() ) ) { - if ( ! ( $dbh = zmDbConnect() ) ) { + while (!($dbh and $dbh->ping())) { + if (!($dbh = zmDbConnect())) { sleep($Config{ZM_WATCH_CHECK_INTERVAL}); } } - my $res = $sth->execute( $Config{ZM_SERVER_ID} ? $Config{ZM_SERVER_ID} : () ) + my $res = $sth->execute($Config{ZM_SERVER_ID} ? $Config{ZM_SERVER_ID} : ()) or Fatal('Can\'t execute: '.$sth->errstr()); - while( my $monitor = $sth->fetchrow_hashref() ) { + while (my $monitor = $sth->fetchrow_hashref()) { next if $monitor->{Function} eq 'None'; next if $monitor->{Type} eq 'WebSite'; my $now = time(); my $restart = 0; if (zmMemVerify($monitor)) { + next if $monitor->{Capturing} eq 'Ondemand'; + # Check we have got an image recently my $capture_time = zmGetLastWriteTime($monitor); if (!defined($capture_time)) {