Skip to content

Commit 447f720

Browse files
author
Oliver Stark
committed
v2.1.1
1 parent f53f835 commit 447f720

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

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

5+
## [2.1.1] - 2020-04-03
6+
### Fix
7+
- Catch Exception when trying to count reserved jobs
8+
59
## [2.1.0] - 2020-03-26
610
### Changed
711
- Replaced `ProcessPool` with `Ratelimiter` to limit the number of concurrent queue runners

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ostark/craft-async-queue",
33
"description": "A queue handler that moves queue execution to a non-blocking background process",
44
"type": "craft-plugin",
5-
"version": "2.1.0",
5+
"version": "2.1.1",
66
"keywords": [
77
"craft",
88
"cms",

src/RateLimiter.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ public function __construct(Queue $queue, Settings $settings)
3636
*/
3737
public function canIUse(string $context = null): bool
3838
{
39-
$reserved = $this->queue->getTotalReserved();
39+
try {
40+
$reserved = $this->queue->getTotalReserved();
41+
} catch (\Exception $exception) {
42+
$reserved = 0;
43+
}
44+
4045
$currentUsage = $this->internalCount + $reserved;
4146

4247
$this->logAttempt($currentUsage, $context);

0 commit comments

Comments
 (0)