only complain about losing the dbh connection, if we can't reconnect

This commit is contained in:
Isaac Connor 2017-07-27 09:56:07 -04:00
parent 33ce55584f
commit 1f8871639a
1 changed files with 10 additions and 9 deletions

View File

@ -144,7 +144,7 @@ MAIN: while( $loop ) {
# After a long sleep, we may need to reconnect to the db
while ( ! ( $dbh and $dbh->ping() ) ) {
$dbh = zmDbConnect();
if ( ! $dbh ) {
if ( $continuous ) {
Error('Unable to connect to database');
# if we are running continuously, then just skip to the next
@ -154,6 +154,7 @@ MAIN: while( $loop ) {
} else {
Fatal('Unable to connect to database');
} # end if
} # end if
} # end while can't connect to the db
my %Monitors;