Skip to content

Commit

Permalink
Update cycle.php
Browse files Browse the repository at this point in the history
PHP notice fix
  • Loading branch information
sergejey committed Sep 24, 2021
1 parent 19693c1 commit c15840a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,13 @@
DebMes("Adding $title to auto-recovery list", 'threads');
$auto_restarts[] = $title;
}
$cycle_updated_timestamp = getGlobal($title . 'Run');

if (!$to_start[$title] && $cycle_updated_timestamp && in_array($title, $auto_restarts) && ((time() - $cycle_updated_timestamp) > 30 * 60)) { //
$cycle_updated_timestamp = getGlobal($title . 'Run');
if (!isset($to_start[$title]) &&
$cycle_updated_timestamp &&
in_array($title, $auto_restarts) &&
((time() - $cycle_updated_timestamp) > 30 * 60)
) { //
DebMes("Looks like $title is dead (updated: ".date('Y-m-d H:i:s',$cycle_updated_timestamp)."). Need to recovery", 'threads');
registerError('cycle_hang', $title);
setGlobal($title . 'Control', 'restart');
Expand Down Expand Up @@ -442,12 +446,12 @@
unset($auto_restarts[$key]);
$auto_restarts = array_values($auto_restarts);
$need_restart = 1;
} elseif ($to_start[$cycle_title]) {
} elseif (isset($to_start[$cycle_title])) {
$need_restart = 1;
}
}
if ($need_restart && $cycle_title) {
if (!$to_start[$cycle_title]) {
if (!isset($to_start[$cycle_title])) {
DebMes("AUTO-RECOVERY: " . $closed_thread, 'threads');
if (!preg_match('/websockets/is', $closed_thread) && !preg_match('/connect/is', $closed_thread)) {
registerError('cycle_stop', $closed_thread . "\n" . $result);
Expand Down

0 comments on commit c15840a

Please sign in to comment.