Skip to content

Commit 3624515

Browse files
committed
fix: fix app initialization in queue:listen command
1 parent 38711da commit 3624515

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/queue/src/Console/ListenCommand.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,13 @@ class ListenCommand extends Command
3636
*/
3737
protected string $description = 'Listen to a given queue';
3838

39-
/**
40-
* The queue listener instance.
41-
*/
42-
protected Listener $listener;
43-
4439
/**
4540
* Create a new queue listen command.
4641
*/
47-
public function __construct(Listener $listener)
48-
{
42+
public function __construct(
43+
protected ConfigInterface $config,
44+
protected Listener $listener
45+
) {
4946
parent::__construct();
5047

5148
$this->setOutputHandler($this->listener = $listener);
@@ -77,9 +74,9 @@ public function handle()
7774
*/
7875
protected function getQueue(?string $connection): string
7976
{
80-
$connection = $connection ?: $this->app->get(ConfigInterface::class)->get('queue.default');
77+
$connection = $connection ?: $this->config->get('queue.default');
8178

82-
return $this->input->getOption('queue') ?: $this->app->get(ConfigInterface::class)->get(
79+
return $this->input->getOption('queue') ?: $this->config->get(
8380
"queue.connections.{$connection}.queue",
8481
'default'
8582
);

0 commit comments

Comments
 (0)