@checkstack/queue-bullmq-backend 0.0.4 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -0
- package/package.json +1 -1
- package/src/index.ts +3 -6
- package/src/plugin.ts +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,108 @@
|
|
|
1
1
|
# @checkstack/queue-bullmq-backend
|
|
2
2
|
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9a27800: Fix recurring jobs resilience and add logger support
|
|
8
|
+
|
|
9
|
+
**Rescheduling Fix:**
|
|
10
|
+
Previously, recurring job rescheduling logic was inside the `try` block of `processJob()`. When a job handler threw an exception and `maxRetries` was exhausted (or 0), the recurring job would never be rescheduled, permanently breaking the scheduling chain.
|
|
11
|
+
|
|
12
|
+
This fix moves the rescheduling logic to the `finally` block, ensuring recurring jobs are always rescheduled after execution, regardless of success or failure.
|
|
13
|
+
|
|
14
|
+
**Heartbeat Mechanism:**
|
|
15
|
+
Added a periodic heartbeat (default: 5 seconds) that checks for ready jobs and triggers processing. This ensures jobs are processed even if `setTimeout` callbacks fail to fire (e.g., after system sleep/wake cycles). Configurable via `heartbeatIntervalMs` option; set to 0 to disable.
|
|
16
|
+
|
|
17
|
+
**Logger Service Integration:**
|
|
18
|
+
|
|
19
|
+
- Added optional `logger` parameter to `QueuePlugin.createQueue()` interface
|
|
20
|
+
- `InMemoryQueue` now uses the provided logger instead of raw `console.error`
|
|
21
|
+
- Consistent with the rest of the codebase's logging patterns
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [9a27800]
|
|
24
|
+
- @checkstack/queue-api@0.0.6
|
|
25
|
+
- @checkstack/backend-api@0.3.1
|
|
26
|
+
|
|
27
|
+
## 0.1.0
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- 9faec1f: # Unified AccessRule Terminology Refactoring
|
|
32
|
+
|
|
33
|
+
This release completes a comprehensive terminology refactoring from "permission" to "accessRule" across the entire codebase, establishing a consistent and modern access control vocabulary.
|
|
34
|
+
|
|
35
|
+
## Changes
|
|
36
|
+
|
|
37
|
+
### Core Infrastructure (`@checkstack/common`)
|
|
38
|
+
|
|
39
|
+
- Introduced `AccessRule` interface as the primary access control type
|
|
40
|
+
- Added `accessPair()` helper for creating read/manage access rule pairs
|
|
41
|
+
- Added `access()` builder for individual access rules
|
|
42
|
+
- Replaced `Permission` type with `AccessRule` throughout
|
|
43
|
+
|
|
44
|
+
### API Changes
|
|
45
|
+
|
|
46
|
+
- `env.registerPermissions()` → `env.registerAccessRules()`
|
|
47
|
+
- `meta.permissions` → `meta.access` in RPC contracts
|
|
48
|
+
- `usePermission()` → `useAccess()` in frontend hooks
|
|
49
|
+
- Route `permission:` field → `accessRule:` field
|
|
50
|
+
|
|
51
|
+
### UI Changes
|
|
52
|
+
|
|
53
|
+
- "Roles & Permissions" tab → "Roles & Access Rules"
|
|
54
|
+
- "You don't have permission..." → "You don't have access..."
|
|
55
|
+
- All permission-related UI text updated
|
|
56
|
+
|
|
57
|
+
### Documentation & Templates
|
|
58
|
+
|
|
59
|
+
- Updated 18 documentation files with AccessRule terminology
|
|
60
|
+
- Updated 7 scaffolding templates with `accessPair()` pattern
|
|
61
|
+
- All code examples use new AccessRule API
|
|
62
|
+
|
|
63
|
+
## Migration Guide
|
|
64
|
+
|
|
65
|
+
### Backend Plugins
|
|
66
|
+
|
|
67
|
+
```diff
|
|
68
|
+
- import { permissionList } from "./permissions";
|
|
69
|
+
- env.registerPermissions(permissionList);
|
|
70
|
+
+ import { accessRules } from "./access";
|
|
71
|
+
+ env.registerAccessRules(accessRules);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### RPC Contracts
|
|
75
|
+
|
|
76
|
+
```diff
|
|
77
|
+
- .meta({ userType: "user", permissions: [permissions.read.id] })
|
|
78
|
+
+ .meta({ userType: "user", access: [access.read] })
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Frontend Hooks
|
|
82
|
+
|
|
83
|
+
```diff
|
|
84
|
+
- const canRead = accessApi.usePermission(permissions.read.id);
|
|
85
|
+
+ const canRead = accessApi.useAccess(access.read);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Routes
|
|
89
|
+
|
|
90
|
+
```diff
|
|
91
|
+
- permission: permissions.entityRead.id,
|
|
92
|
+
+ accessRule: access.read,
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- Updated dependencies [9faec1f]
|
|
98
|
+
- Updated dependencies [827b286]
|
|
99
|
+
- Updated dependencies [f533141]
|
|
100
|
+
- Updated dependencies [aa4a8ab]
|
|
101
|
+
- @checkstack/backend-api@0.3.0
|
|
102
|
+
- @checkstack/common@0.2.0
|
|
103
|
+
- @checkstack/queue-bullmq-common@0.1.0
|
|
104
|
+
- @checkstack/queue-api@0.0.5
|
|
105
|
+
|
|
3
106
|
## 0.0.4
|
|
4
107
|
|
|
5
108
|
### Patch Changes
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createBackendPlugin,
|
|
3
|
-
coreServices,
|
|
4
|
-
} from "@checkstack/backend-api";
|
|
1
|
+
import { createBackendPlugin, coreServices } from "@checkstack/backend-api";
|
|
5
2
|
import { BullMQPlugin } from "./plugin";
|
|
6
|
-
import {
|
|
3
|
+
import { queueBullmqAccessRules } from "@checkstack/queue-bullmq-common";
|
|
7
4
|
import { pluginMetadata } from "./plugin-metadata";
|
|
8
5
|
|
|
9
6
|
export default createBackendPlugin({
|
|
10
7
|
metadata: pluginMetadata,
|
|
11
8
|
register(env) {
|
|
12
|
-
env.
|
|
9
|
+
env.registerAccessRules(queueBullmqAccessRules);
|
|
13
10
|
|
|
14
11
|
env.registerInit({
|
|
15
12
|
deps: {
|
package/src/plugin.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { QueuePlugin, Queue } from "@checkstack/queue-api";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
configString,
|
|
4
|
+
configNumber,
|
|
5
|
+
type Logger,
|
|
6
|
+
} from "@checkstack/backend-api";
|
|
3
7
|
import { z } from "zod";
|
|
4
8
|
import { BullMQQueue } from "./bullmq-queue";
|
|
5
9
|
|
|
@@ -30,7 +34,12 @@ export class BullMQPlugin implements QueuePlugin<BullMQConfig> {
|
|
|
30
34
|
configVersion = 1;
|
|
31
35
|
configSchema = configSchema;
|
|
32
36
|
|
|
33
|
-
createQueue<T>(
|
|
37
|
+
createQueue<T>(
|
|
38
|
+
name: string,
|
|
39
|
+
config: BullMQConfig,
|
|
40
|
+
_logger: Logger
|
|
41
|
+
): Queue<T> {
|
|
42
|
+
// Note: BullMQ has its own logging via Redis events
|
|
34
43
|
return new BullMQQueue<T>(name, config);
|
|
35
44
|
}
|
|
36
45
|
}
|