Skip to content

Commit

Permalink
v2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Stark committed Apr 3, 2020
1 parent f53f835 commit 447f720
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## [2.1.1] - 2020-04-03
### Fix
- Catch Exception when trying to count reserved jobs

## [2.1.0] - 2020-03-26
### Changed
- Replaced `ProcessPool` with `Ratelimiter` to limit the number of concurrent queue runners
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ostark/craft-async-queue",
"description": "A queue handler that moves queue execution to a non-blocking background process",
"type": "craft-plugin",
"version": "2.1.0",
"version": "2.1.1",
"keywords": [
"craft",
"cms",
Expand Down
7 changes: 6 additions & 1 deletion src/RateLimiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ public function __construct(Queue $queue, Settings $settings)
*/
public function canIUse(string $context = null): bool
{
$reserved = $this->queue->getTotalReserved();
try {
$reserved = $this->queue->getTotalReserved();
} catch (\Exception $exception) {
$reserved = 0;
}

$currentUsage = $this->internalCount + $reserved;

$this->logAttempt($currentUsage, $context);
Expand Down

0 comments on commit 447f720

Please sign in to comment.