Skip to content

Commit

Permalink
Merge pull request #3 from boboldehampsink/patch-1
Browse files Browse the repository at this point in the history
Don't take failed jobs into account
  • Loading branch information
bvangennep authored May 6, 2021
2 parents 27ecf03 + 0e248b7 commit 9db578f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 3 additions & 1 deletion src/controllers/InfoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
]]);
}
}

0 comments on commit 9db578f

Please sign in to comment.