8000 bug #38618 [Messenger][Doctrine] Avoid early db access for pgsql dete… · symfony/symfony@4fdacdb · GitHub
[go: up one dir, main page]

Skip to content

Commit 4fdacdb

Browse files
committed
bug #38618 [Messenger][Doctrine] Avoid early db access for pgsql detection (chalasr)
This PR was merged into the 5.1 branch. Discussion ---------- [Messenger][Doctrine] Avoid early db access for pgsql detection | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #37069 | License | MIT | Doc PR | - Keeps the connection lazy using an instanceof check on the DBAL driver instead. Commits ------- c4cc4a3 [Messenger][Doctrine] Avoid early db access for pgsql detection
2 parents 6bbab59 + c4cc4a3 commit 4fdacdb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransportFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Messenger\Bridge\Doctrine\Transport;
1313

14+
use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver;
1415
use Doctrine\Persistence\ConnectionRegistry;
1516
use Symfony\Bridge\Doctrine\RegistryInterface;
1617
use Symfony\Component\Messenger\Exception\TransportException;
@@ -47,7 +48,7 @@ public function createTransport(string $dsn, array $options, SerializerInterface
4748
throw new TransportException(sprintf('Could not find Doctrine connection from Messenger DSN "%s".', $dsn), 0, $e);
4849
}
4950

50-
if ($useNotify && ($wrappedConnection = $driverConnection->getWrappedConnection()) && method_exists($wrappedConnection, 'pgsqlGetNotify')) {
51+
if ($useNotify && $driverConnection->getDriver() instanceof AbstractPostgreSQLDriver) {
5152
$connection = new PostgreSqlConnection($configuration, $driverConnection);
5253
} else {
5354
$connection = new Connection($configuration, $driverConnection);

0 commit comments

Comments
 (0)
0