patchrelay 0.8.8 → 0.8.9

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "service": "patchrelay",
3
- "version": "0.8.8",
4
- "commit": "bb19f4030c2a",
5
- "builtAt": "2026-03-19T12:17:38.751Z"
3
+ "version": "0.8.9",
4
+ "commit": "a82762db78db",
5
+ "builtAt": "2026-03-19T12:29:25.534Z"
6
6
  }
@@ -1,6 +1,7 @@
1
1
  import { SerialWorkQueue } from "./service-queue.js";
2
2
  const ISSUE_KEY_DELIMITER = "::";
3
3
  const DEFAULT_RECONCILE_INTERVAL_MS = 5_000;
4
+ const DEFAULT_RECONCILE_TIMEOUT_MS = 60_000;
4
5
  function toReconciler(value) {
5
6
  if (typeof value === "function") {
6
7
  return {
@@ -124,7 +125,7 @@ export class ServiceRuntime {
124
125
  }
125
126
  this.reconcileInProgress = true;
126
127
  try {
127
- await this.stageRunReconciler.reconcileActiveStageRuns();
128
+ await promiseWithTimeout(this.stageRunReconciler.reconcileActiveStageRuns(), this.options.reconcileTimeoutMs ?? DEFAULT_RECONCILE_TIMEOUT_MS, "Background active-stage reconciliation");
128
129
  }
129
130
  catch (error) {
130
131
  this.logger.warn({
@@ -139,3 +140,18 @@ export class ServiceRuntime {
139
140
  }
140
141
  }
141
142
  }
143
+ function promiseWithTimeout(promise, timeoutMs, label) {
144
+ return new Promise((resolve, reject) => {
145
+ const timeout = setTimeout(() => {
146
+ reject(new Error(`${label} timed out after ${timeoutMs}ms`));
147
+ }, timeoutMs);
148
+ timeout.unref?.();
149
+ promise.then((value) => {
150
+ clearTimeout(timeout);
151
+ resolve(value);
152
+ }, (error) => {
153
+ clearTimeout(timeout);
154
+ reject(error);
155
+ });
156
+ });
157
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchrelay",
3
- "version": "0.8.8",
3
+ "version": "0.8.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {