[Messenger][Doctrine] Avoid early db access for pgsql detection
This commit is contained in:
parent
6bbab591c8
commit
c4cc4a338b
@ -11,6 +11,7 @@
|
||||
|
||||
namespace Symfony\Component\Messenger\Bridge\Doctrine\Transport;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver;
|
||||
use Doctrine\Persistence\ConnectionRegistry;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Symfony\Component\Messenger\Exception\TransportException;
|
||||
@ -47,7 +48,7 @@ class DoctrineTransportFactory implements TransportFactoryInterface
|
||||
throw new TransportException(sprintf('Could not find Doctrine connection from Messenger DSN "%s".', $dsn), 0, $e);
|
||||
}
|
||||
|
||||
if ($useNotify && ($wrappedConnection = $driverConnection->getWrappedConnection()) && method_exists($wrappedConnection, 'pgsqlGetNotify')) {
|
||||
if ($useNotify && $driverConnection->getDriver() instanceof AbstractPostgreSQLDriver) {
|
||||
$connection = new PostgreSqlConnection($configuration, $driverConnection);
|
||||
} else {
|
||||
$connection = new Connection($configuration, $driverConnection);
|
||||
|
Reference in New Issue
Block a user