@checkstack/queue-api 0.0.5 → 0.0.6

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,26 @@
1
1
  # @checkstack/queue-api
2
2
 
3
+ ## 0.0.6
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
+ - @checkstack/backend-api@0.3.1
23
+
3
24
  ## 0.0.5
4
25
 
5
26
  ### 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.0.6",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import type { Queue } from "./queue";
3
- import type { Migration } from "@checkstack/backend-api";
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 {