From 62c6c7a74129c6667ba9d1e6aa5c43453e64ee11 Mon Sep 17 00:00:00 2001 From: Mikel Date: Wed, 23 Mar 2022 16:51:57 +0100 Subject: [PATCH] core: replaced ping method that used to check that dfb connection was alive related to: doctrine/dbal/pull/4119 --- .../realtime/src/Services/RegistrationChannelResolver.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/microservices/realtime/src/Services/RegistrationChannelResolver.php b/microservices/realtime/src/Services/RegistrationChannelResolver.php index 25b880ae64f..e1d01e3701e 100644 --- a/microservices/realtime/src/Services/RegistrationChannelResolver.php +++ b/microservices/realtime/src/Services/RegistrationChannelResolver.php @@ -2,6 +2,7 @@ namespace Services; +use Doctrine\DBAL\Exception\ConnectionLost; use Doctrine\ORM\EntityManagerInterface; use Ivoz\Provider\Domain\Model\Administrator\AdministratorInterface; use Ivoz\Provider\Domain\Model\Administrator\AdministratorRepository; @@ -36,8 +37,9 @@ public function criteriaToString( array $registerCriteria ) { $connection = $this->em->getConnection(); - $pingError = !$connection->ping(); - if ($pingError) { + try { + $connection->executeStatement('SELECT 1'); + } catch (ConnectionLost $e) { $connection->close(); $connection->connect(); }