Skip to content

Commit

Permalink
Minor QueueCommands cleaning (#5967)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Apr 26, 2024
1 parent a5e6097 commit b5364e5
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/Commands/core/QueueCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ final class QueueCommands extends DrushCommands
const LIST = 'queue:list';
const DELETE = 'queue:delete';

protected QueueWorkerManagerInterface $workerManager;

protected $queueService;

public function __construct(QueueWorkerManagerInterface $workerManager, QueueFactory $queueService)
{
$this->workerManager = $workerManager;
$this->queueService = $queueService;
// Keep track of queue definitions.
protected static array $queues;

public function __construct(
protected QueueWorkerManagerInterface $workerManager,
protected QueueFactory $queueService
) {
parent::__construct();
}

public function getWorkerManager(): QueueWorkerManagerInterface
Expand All @@ -47,13 +47,6 @@ public function getQueueService(): QueueFactory
return $this->queueService;
}

/**
* Keep track of queue definitions.
*
* @var array
*/
protected static $queues;

/**
* Run a specific queue by name.
*/
Expand Down Expand Up @@ -87,7 +80,7 @@ public function run(string $name, $options = ['time-limit' => self::REQ, 'items-
$worker->processItem($item->data);
$queue->deleteItem($item);
$count++;
} catch (RequeueException $e) {
} catch (RequeueException) {
// The worker requested the task to be immediately requeued.
$queue->releaseItem($item);
} catch (SuspendQueueException $e) {
Expand Down

0 comments on commit b5364e5

Please sign in to comment.