Fix logic on error reporting of failure to connect to db

This commit is contained in:
Isaac Connor 2022-02-28 09:38:54 -05:00
parent 7ef9824736
commit a32b77510d
1 changed files with 5 additions and 5 deletions

View File

@ -115,11 +115,11 @@ while (1) {
$Config{ZM_TELEMETRY_LAST_UPLOAD} = $now;
}
zmDbDisconnect();
} elsif ( -t STDIN ) {
print "ZoneMinder Telemetry Agent sleeping for $interval seconds because ($now-$lastCheck=$since_last_check > $interval\n";
} else {
Error('Failed to open database. Sleeping.');
}
} else {
Error("Failed to opem database. Sleeping.");
} elsif (-t STDIN) {
print "ZoneMinder Telemetry Agent sleeping for $interval seconds because ($now-$lastCheck=$since_last_check > $interval\n";
}
$lastCheck = $now;
sleep($interval);