From 7e554a750b318468317fe3095f6efaf38328a692 Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Fri, 2 Feb 2024 22:25:02 +0300 Subject: [PATCH 1/2] pkp/pkp-lib#9686 Fixed the setup for the worker configuration --- classes/queue/WorkerConfiguration.php | 2 -- tools/jobs.php | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/classes/queue/WorkerConfiguration.php b/classes/queue/WorkerConfiguration.php index d326a474384..09a744f5fc8 100644 --- a/classes/queue/WorkerConfiguration.php +++ b/classes/queue/WorkerConfiguration.php @@ -1,7 +1,5 @@ $this->getParameterValue('--name', $workerConfig->getName()), - 'backoff' => $this->getParameterValue('--backoff', $workerConfig->getBackoff()), - 'memory' => $this->getParameterValue('--memory', $workerConfig->getMemory()), - 'timeout' => $this->getParameterValue('--timeout', $workerConfig->getTimeout()), - 'sleep' => $this->getParameterValue('--sleep', $workerConfig->getSleep()), - 'maxTries' => $this->getParameterValue('--tries', $workerConfig->getMaxTries()), - 'force' => $this->getParameterValue('--force', in_array('--force', $parameters) ? true : $workerConfig->getForce()), - 'stopWhenEmpty' => $this->getParameterValue('--stop-when-empty', in_array('--stop-when-empty', $parameters) ? true : $workerConfig->getStopWhenEmpty()), - 'maxJobs' => $this->getParameterValue('--max-jobs', $workerConfig->getMaxJobs()), - 'maxTime' => $this->getParameterValue('--max-time', $workerConfig->getMaxTime()), - 'rest' => $this->getParameterValue('--rest', $workerConfig->getRest()), + 'name' => $this->getParameterValue('name', $workerConfig->getName()), + 'backoff' => $this->getParameterValue('backoff', $workerConfig->getBackoff()), + 'memory' => $this->getParameterValue('memory', $workerConfig->getMemory()), + 'timeout' => $this->getParameterValue('timeout', $workerConfig->getTimeout()), + 'sleep' => $this->getParameterValue('sleep', $workerConfig->getSleep()), + 'maxTries' => $this->getParameterValue('tries', $workerConfig->getMaxTries()), + 'force' => $this->getParameterValue('force', in_array('force', $parameters) ? true : $workerConfig->getForce()), + 'stopWhenEmpty' => $this->getParameterValue('stop-when-empty', in_array('stop-when-empty', $parameters) ? true : $workerConfig->getStopWhenEmpty()), + 'maxJobs' => $this->getParameterValue('max-jobs', $workerConfig->getMaxJobs()), + 'maxTime' => $this->getParameterValue('max-time', $workerConfig->getMaxTime()), + 'rest' => $this->getParameterValue('rest', $workerConfig->getRest()), ]; } From d1a92ea843459eeec709acc4a9a29c840f9ac7b3 Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Sat, 3 Feb 2024 21:37:02 +0300 Subject: [PATCH 2/2] pkp/pkp-lib#9686 Fixed the queue parameter --- tools/jobs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/jobs.php b/tools/jobs.php index f7a98c6fb7f..05cf0c521d2 100644 --- a/tools/jobs.php +++ b/tools/jobs.php @@ -233,7 +233,7 @@ protected function failed(): void if (in_array('--redispatch', $parameterList) || ($jobIds = $this->getParameterValue('redispatch'))) { $jobsCount = Repo::failedJob()->redispatchToQueue( - $this->getParameterValue('--queue'), + $this->getParameterValue('queue'), collect(explode(',', $jobIds ?? '')) ->filter() ->map(fn ($item) => (int)$item) @@ -245,7 +245,7 @@ protected function failed(): void if (in_array('--clear', $parameterList) || ($jobIds = $this->getParameterValue('clear'))) { $jobsCount = Repo::failedJob()->deleteJobs( - $this->getParameterValue('--queue'), + $this->getParameterValue('queue'), collect(explode(',', $jobIds ?? '')) ->filter() ->map(fn ($item) => (int)$item)