Skip to content

Commit 3db6f43

Browse files
committed
Updates connection handling in BackgroundQueue
Updates the BackgroundQueue to directly use the connection object provided in the configuration. This simplifies the connection process and relies on the consumer to pass an already established connection, removing the need for connection creation within the class.
1 parent 7dbeca2 commit 3db6f43

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/BackgroundQueue.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ class BackgroundQueue
4747
*/
4848
public function __construct(array $config)
4949
{
50-
if (is_string($config['connection'])) {
51-
$config['connection'] = $this->parseDsn($config['connection']);
52-
}
5350
if (empty($config['waitingJobExpiration'])) {
5451
$config['waitingJobExpiration'] = 1000;
5552
}
@@ -85,7 +82,7 @@ public function __construct(array $config)
8582
}
8683

8784
$this->config = $config;
88-
$this->connection = DriverManager::getConnection($config['connection']);
85+
$this->connection = $config['connection'];
8986
$this->logger = $config['logger'] ?: new NullLogger();
9087
if ($config['producer']) {
9188
$this->producer = $config['producer'];

0 commit comments

Comments
 (0)