Skip to content

Commit

Permalink
Improve database availability detection
Browse files Browse the repository at this point in the history
  • Loading branch information
rsanzante committed Jan 25, 2024
1 parent 5abc5ed commit 3e1bac3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ protected function waitDatabase() {
$count = 10;
while ($count) {
$this->io->write('Waiting for database to be ready....');
$result = exec('. ./.env; ' . $this->dockerComposeCmd . ' exec -u root mariadb mysql -u${DB_USER} -p${DB_PASSWORD} ${DB_NAME} -e "SELECT 1 AS result"| grep "1 |" | wc -l');
$result = trim(shell_exec('. ./.env; ' . $this->dockerComposeCmd . ' exec -u root mariadb mysql -u${DB_USER} -p${DB_PASSWORD} ${DB_NAME} -e "SELECT 1234567890 AS result"| grep "1234567890" | wc -l'));
if ($result === "1") {
$this->io->write('Database ready!');
return;
Expand Down

0 comments on commit 3e1bac3

Please sign in to comment.