diff --git a/CHANGELOG.md b/CHANGELOG.md index 0202298..9f84770 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.0.3 - 2021-05-06 +### Fixed +- Don't take failed jobs into account + +## 1.0.2 - 2021-03-04 +### Added +- Added PHP8 support + ## 1.0.1 - 2020-03-19 ### Fixed - Take all jobs into account, not only pending jobs diff --git a/composer.json b/composer.json index 87cf865..b8fcc60 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "version": "1.0.2", + "version": "1.0.3", "name": "nerds-and-company/craft-hirefire", "description": "Hirefire.io worker scheduler for Craft 3 queue jobs", "type": "craft-plugin", diff --git a/src/controllers/InfoController.php b/src/controllers/InfoController.php index a16fa1c..d9f3f86 100644 --- a/src/controllers/InfoController.php +++ b/src/controllers/InfoController.php @@ -33,10 +33,12 @@ public function actionIndex(string $token): Response throw new UserException(Craft::t('hirefire', 'Invalid Hirefire token.')); } + $queue = Craft::$app->queue; + // Return pending queue for worker return $this->asJson([[ 'name' => 'worker', - 'quantity' => Craft::$app->queue->getTotalJobs(), + 'quantity' => $queue->getTotalJobs() - $queue->getTotalFailed(), ]]); } }