@rizom/ops 0.2.0-alpha.425 → 0.2.0-alpha.426

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rizom/ops",
3
- "version": "0.2.0-alpha.425",
3
+ "version": "0.2.0-alpha.426",
4
4
  "description": "Operator CLI for managing private brain fleet registry repos",
5
5
  "keywords": [
6
6
  "brains",
@@ -575,6 +575,8 @@ function shellSafe(value: string, name: string): string {
575
575
  * (transactional copies, quick_check, checksums), so it needs a serving
576
576
  * runtime with no queued work, not a healthy one: a deploy is often the fix
577
577
  * for whatever a plugin reports as degraded. Degradation is named, not refused.
578
+ * A job whose lease expired is abandoned, not running: the next worker
579
+ * reclaims and reruns it, so it is named and backed up as it stands.
578
580
  */
579
581
  export function renderPredeployReadinessProgram(
580
582
  healthUrl: string = "http://127.0.0.1:8080/health/ready",
@@ -586,10 +588,14 @@ if (response.status !== 200 || health.status !== "ready") {
586
588
  console.error("pre-deploy snapshot: current runtime is not ready");
587
589
  process.exit(1);
588
590
  }
589
- if (queue && (queue.totals?.pending !== 0 || queue.totals?.processing !== 0 || queue.staleLeaseCount !== 0)) {
591
+ const abandoned = queue?.staleLeaseCount ?? 0;
592
+ if (queue && (queue.totals?.pending !== 0 || queue.totals?.processing !== abandoned)) {
590
593
  console.error("pre-deploy snapshot: job queue is not idle");
591
594
  process.exit(1);
592
595
  }
596
+ if (abandoned > 0) {
597
+ console.error("pre-deploy snapshot: " + abandoned + " abandoned job(s) will rerun after the deploy");
598
+ }
593
599
  if (health.operationalStatus !== "operational") {
594
600
  const degraded = (health.checks ?? []).filter((check) => check.status !== "healthy").map((check) => check.name);
595
601
  console.error("pre-deploy snapshot: runtime is degraded (" + degraded.join(", ") + "); backing it up anyway");