Commit 7f669dea authored by Jon Pugh's avatar Jon Pugh

Add static variable to Docker database connect() method to prevent running...

Add static variable to Docker database connect() method to prevent running through all these loops over and over again.
parent a871e62e
......@@ -65,6 +65,11 @@ class DbMysqlDockerService extends DbMysqlService implements DockerServiceInterf
*/
function connect()
{
// If already connected, just return TRUE;
static $connected;
if ($connected) {
return TRUE;
}
$start = time();
$command = $this->getProvision()->getTasks()->taskExec('docker-compose exec db')
......@@ -96,6 +101,9 @@ class DbMysqlDockerService extends DbMysqlService implements DockerServiceInterf
sleep(1);
$this->getProvision()->getLogger()->info('Waiting for MySQL to become available...');
}
// Set static variable to indicate we are connected.
$connected = TRUE;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment