@checkstack/queue-api 0.0.5 → 0.1.0

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 CHANGED
@@ -1,5 +1,53 @@
1
1
  # @checkstack/queue-api
2
2
 
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 180be38: # Queue Lag Warning
8
+
9
+ Added a queue lag warning system that displays alerts when pending jobs exceed configurable thresholds.
10
+
11
+ ## Features
12
+
13
+ - **Backend Stats API**: New `getStats`, `getLagStatus`, and `updateLagThresholds` RPC endpoints
14
+ - **Signal-based Updates**: `QUEUE_LAG_CHANGED` signal for real-time frontend updates
15
+ - **Aggregated Stats**: `QueueManager.getAggregatedStats()` sums stats across all queues
16
+ - **Configurable Thresholds**: Warning (default 100) and Critical (default 500) thresholds stored in config
17
+ - **Dashboard Integration**: Queue lag alert displayed on main Dashboard (access-gated)
18
+ - **Queue Settings Page**: Lag alert and Performance Tuning guidance card with concurrency tips
19
+
20
+ ## UI Changes
21
+
22
+ - Queue lag alert banner appears on Dashboard and Queue Settings when pending jobs exceed thresholds
23
+ - New "Performance Tuning" card with concurrency settings guidance and bottleneck indicators
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [7a23261]
28
+ - @checkstack/backend-api@0.3.2
29
+
30
+ ## 0.0.6
31
+
32
+ ### Patch Changes
33
+
34
+ - 9a27800: Fix recurring jobs resilience and add logger support
35
+
36
+ **Rescheduling Fix:**
37
+ 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.
38
+
39
+ This fix moves the rescheduling logic to the `finally` block, ensuring recurring jobs are always rescheduled after execution, regardless of success or failure.
40
+
41
+ **Heartbeat Mechanism:**
42
+ 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.
43
+
44
+ **Logger Service Integration:**
45
+
46
+ - Added optional `logger` parameter to `QueuePlugin.createQueue()` interface
47
+ - `InMemoryQueue` now uses the provided logger instead of raw `console.error`
48
+ - Consistent with the rest of the codebase's logging patterns
49
+ - @checkstack/backend-api@0.3.1
50
+
3
51
  ## 0.0.5
4
52
 
5
53
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/queue-api",
3
- "version": "0.0.5",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import type { Queue } from "./queue";
3
- import type { Migration } from "@checkstack/backend-api";
2
+ import type { Queue, QueueStats } from "./queue";
3
+ import type { Migration, Logger } from "@checkstack/backend-api";
4
4
 
5
5
  export interface QueuePlugin<Config = unknown> {
6
6
  id: string;
@@ -16,7 +16,7 @@ export interface QueuePlugin<Config = unknown> {
16
16
  /** Optional migrations for backward compatibility */
17
17
  migrations?: Migration<unknown, unknown>[];
18
18
 
19
- createQueue<T>(name: string, config: Config): Queue<T>;
19
+ createQueue<T>(name: string, config: Config, logger: Logger): Queue<T>;
20
20
  }
21
21
 
22
22
  export interface QueuePluginRegistry {
@@ -84,6 +84,12 @@ export interface QueueManager {
84
84
  */
85
85
  getInFlightJobCount(): Promise<number>;
86
86
 
87
+ /**
88
+ * Get aggregated statistics across all queues.
89
+ * Used for monitoring and lag detection.
90
+ */
91
+ getAggregatedStats(): Promise<QueueStats>;
92
+
87
93
  /**
88
94
  * List all recurring jobs across all queues.
89
95
  * Used for migration preview.