mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 01:33:11 +08:00
Changed mechanism to determine if connection to database worked for health endpoint
This commit is contained in:
@@ -32,7 +32,9 @@ class HealthAction extends AbstractRestAction
|
||||
public function handle(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
$connected = $this->em->getConnection()->isConnected();
|
||||
$connection = $this->em->getConnection();
|
||||
$connection->executeQuery($connection->getDatabasePlatform()->getDummySelectSQL());
|
||||
$connected = true;
|
||||
} catch (Throwable) {
|
||||
$connected = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user