Skip to content
Permalink
Browse files

Update cycle.php

Auto-restart fix
  • Loading branch information...
sergejey committed Sep 25, 2019
1 parent b41fbc1 commit 6998b76e2f201f785d4d3ce581768fbf5eece7e0
Showing with 4 additions and 2 deletions.
  1. +4 −2 cycle.php
@@ -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);
}
}

0 comments on commit 6998b76

Please sign in to comment.
You can’t perform that action at this time.