Skip to content

Commit

Permalink
wait for db, ghost misfire
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveorevo committed Dec 7, 2023
1 parent dbb9952 commit 265cad2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nodeapp.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ public function hcpp_runuser( $cmd ) {
*/
public function hcpp_rebooted() {

// Wait up to 60 additional seconds for MySQL to start
$i = 0;
while ( $i < 60 ) {
$i++;
$mysql = shell_exec( 'systemctl is-active mysql' );
if ( trim( $mysql ) == 'active' ) {
break;
}
sleep( 1 );
}

// Restart all PM2 apps for all user accounts
$users = scandir('/home');
global $hcpp;
Expand Down

0 comments on commit 265cad2

Please sign in to comment.