Only try to reboot if we can ping. The open can hang a long time, and so a rebooting camera can then be told to reboot again, causing an endless cycle

pull/3825/merge
Isaac Connor 2024-11-19 10:27:59 -05:00
parent 19bd85c9f2
commit 566ce16230
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ while (!$zm_terminate) {
Debug("Monitor $monitor->{Id} $monitor->{Name}, startup time $now - $startup_time $startup_elapsed <? $Config{ZM_WATCH_MAX_DELAY}");
if ($monitor->ControlId()) {
my $control = $monitor->Control();
if ($control and $control->CanReboot() and $control->open()) {
if ($control and $control->CanReboot() and $control->ping() and $control->open()) {
$control->reboot();
}
}