private function assertGoodDatabaseConnection()
    {
        $connection = $this->entityManager->getConnection();

        if ($connection->ping() === false) {
            $connection->close();
            $connection->connect();
        }
    }
private function assertGoodDatabaseConnection()
    {
        $connection = $this->entityManager->getConnection();

        if ($connection->ping() === false) {
            $connection->close();
            $connection->connect();
        }
    }
private function assertGoodDatabaseConnection ( ) { $ connection = $ this -> entityManager -> getConnection ( ) ; if ( $ connection -> ping ( ) === false ) { $ connection -> close ( ) ; $ connection -> connect ( ) ; } }
Some database systems close the connection after a period of time, in MySQL this is system variable
`wait_timeout`. Given the daemon is meant to run indefinitely we need to make sure we have an open
connection before working any job. Otherwise we would see `MySQL has gone away` type errors.
Some database systems close the connection after a period of time in MySQL this is system variable wait_timeout . Given the daemon is meant to run indefinitely we need to make sure we have an open connection before working any job . Otherwise we would see MySQL has gone away type errors .