Skip to content

Commit

Permalink
Update cycle.php
Browse files Browse the repository at this point in the history
Auto-restart fix
  • Loading branch information
sergejey committed Sep 25, 2019
1 parent b41fbc1 commit 6998b76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
$connected = $db->Connect();
if (!$connected) {
if (file_exists($db_filename) && !IsWindowsOS() && $total_restarts<3) {
$total_restarts++;
echo "Restarting mysql service..." . PHP_EOL;
exec("sudo service mysql restart"); // trying to restart mysql
$total_restarts++;
sleep(10);
} else {
sleep(5);
}
sleep(10);
}
}

Expand Down

0 comments on commit 6998b76

Please sign in to comment.