From 0a408efd108b4818d0cc6d3cd8449b01aaaafd22 Mon Sep 17 00:00:00 2001 From: Mark Scherer Date: Sun, 24 May 2026 19:10:27 +0200 Subject: [PATCH 1/7] Run PHPCS cleanup --- src/Model/Table/QueuedJobsTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Table/QueuedJobsTable.php b/src/Model/Table/QueuedJobsTable.php index ab4398d8..52676e44 100644 --- a/src/Model/Table/QueuedJobsTable.php +++ b/src/Model/Table/QueuedJobsTable.php @@ -267,7 +267,7 @@ public function createJob(string $jobTask, array|object|null $data = null, array * * @return string */ - protected function jobTask(string $jobType): string { +protected function jobTask(string $jobType): string { if (!($this->taskFinder instanceof TaskFinder)) { $this->taskFinder = new TaskFinder(); } From 3e417e0e1d96c6686b31494e54d3f6315a270955 Mon Sep 17 00:00:00 2001 From: Mark Scherer Date: Mon, 25 May 2026 04:29:54 +0200 Subject: [PATCH 2/7] Address queue review follow-ups --- src/Model/Table/QueuedJobsTable.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Model/Table/QueuedJobsTable.php b/src/Model/Table/QueuedJobsTable.php index 52676e44..195728ba 100644 --- a/src/Model/Table/QueuedJobsTable.php +++ b/src/Model/Table/QueuedJobsTable.php @@ -267,7 +267,11 @@ public function createJob(string $jobTask, array|object|null $data = null, array * * @return string */ -protected function jobTask(string $jobType): string { +<<<<<<< HEAD + protected function jobTask(string $jobType): string { +======= + protected function jobTask(string $jobType): string { +>>>>>>> e852801 (Address queue review follow-ups) if (!($this->taskFinder instanceof TaskFinder)) { $this->taskFinder = new TaskFinder(); } From 1aa2499b215362b4806b154cab5a68c9a63b5e84 Mon Sep 17 00:00:00 2001 From: Mark Scherer Date: Mon, 25 May 2026 15:11:30 +0200 Subject: [PATCH 3/7] Remove stale queue results annotation --- src/Model/Table/QueueProcessesTable.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Model/Table/QueueProcessesTable.php b/src/Model/Table/QueueProcessesTable.php index 49f2c0b8..fcbbaa53 100644 --- a/src/Model/Table/QueueProcessesTable.php +++ b/src/Model/Table/QueueProcessesTable.php @@ -236,13 +236,12 @@ public function status(): array { $timeout = Config::defaultworkertimeout(); $thresholdTime = (new DateTime())->subSeconds($timeout); - $results = $this->find() - ->where(['modified >' => $thresholdTime]) - ->orderByDesc('modified') - ->enableHydration(false) - ->all() - ->toArray(); - /** @var array $results */ + $results = $this->find() + ->where(['modified >' => $thresholdTime]) + ->orderByDesc('modified') + ->enableHydration(false) + ->all() + ->toArray(); if (!$results) { return []; From 15504f8d8b91a5eea18348d052a38d693c81c8f6 Mon Sep 17 00:00:00 2001 From: Mark Scherer Date: Mon, 25 May 2026 15:31:34 +0200 Subject: [PATCH 4/7] Restore !empty ternary in queue cleanup --- src/Queue/Task/ProgressExampleTask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Queue/Task/ProgressExampleTask.php b/src/Queue/Task/ProgressExampleTask.php index a1e59f9b..81ab7cea 100644 --- a/src/Queue/Task/ProgressExampleTask.php +++ b/src/Queue/Task/ProgressExampleTask.php @@ -75,7 +75,7 @@ public function description(): ?string { public function run(array $data, int $jobId): void { $this->io->hr(); $this->io->out('CakePHP Queue ProgressExample task.'); - $seconds = empty($data['duration']) ? 2 * static::MINUTE : (int)$data['duration']; + $seconds = !empty($data['duration']) ? (int)$data['duration'] : 2 * static::MINUTE; $this->io->out('A total of ' . $seconds . ' seconds need to pass...'); for ($i = 0; $i < $seconds; $i++) { From e84f37071a06ca52e8ace2c3f74630c88e3a144e Mon Sep 17 00:00:00 2001 From: Mark Scherer Date: Mon, 25 May 2026 15:34:03 +0200 Subject: [PATCH 5/7] Fix queue rebase marker --- src/Model/Table/QueuedJobsTable.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Model/Table/QueuedJobsTable.php b/src/Model/Table/QueuedJobsTable.php index 195728ba..ab4398d8 100644 --- a/src/Model/Table/QueuedJobsTable.php +++ b/src/Model/Table/QueuedJobsTable.php @@ -267,11 +267,7 @@ public function createJob(string $jobTask, array|object|null $data = null, array * * @return string */ -<<<<<<< HEAD protected function jobTask(string $jobType): string { -======= - protected function jobTask(string $jobType): string { ->>>>>>> e852801 (Address queue review follow-ups) if (!($this->taskFinder instanceof TaskFinder)) { $this->taskFinder = new TaskFinder(); } From 0a2d1d6117a885031b53622ed23ee82b59602bfa Mon Sep 17 00:00:00 2001 From: Mark Scherer Date: Mon, 25 May 2026 15:38:38 +0200 Subject: [PATCH 6/7] Fix queue review follow-up --- src/Model/Table/QueueProcessesTable.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Model/Table/QueueProcessesTable.php b/src/Model/Table/QueueProcessesTable.php index fcbbaa53..4e29e908 100644 --- a/src/Model/Table/QueueProcessesTable.php +++ b/src/Model/Table/QueueProcessesTable.php @@ -236,12 +236,12 @@ public function status(): array { $timeout = Config::defaultworkertimeout(); $thresholdTime = (new DateTime())->subSeconds($timeout); - $results = $this->find() - ->where(['modified >' => $thresholdTime]) - ->orderByDesc('modified') - ->enableHydration(false) - ->all() - ->toArray(); + $results = $this->find() + ->where(['modified >' => $thresholdTime]) + ->orderByDesc('modified') + ->enableHydration(false) + ->all() + ->toArray(); if (!$results) { return []; From 1a2132dd61a102b89bd8ca374522bedd266eb9a0 Mon Sep 17 00:00:00 2001 From: Mark Scherer Date: Mon, 25 May 2026 15:50:43 +0200 Subject: [PATCH 7/7] Fix queue process status typing --- src/Model/Table/QueueProcessesTable.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Model/Table/QueueProcessesTable.php b/src/Model/Table/QueueProcessesTable.php index 4e29e908..bfb500d3 100644 --- a/src/Model/Table/QueueProcessesTable.php +++ b/src/Model/Table/QueueProcessesTable.php @@ -248,6 +248,7 @@ public function status(): array { } $count = count($results); + /** @var array{modified: \Cake\I18n\DateTime} $record */ $record = array_shift($results); /** @var \Cake\I18n\DateTime $time */ $time = $record['modified'];