@dudousxd/nestjs-durable-core 0.49.0 → 0.49.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/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1113,6 +1113,16 @@ interface GroupHealth {
|
|
|
1113
1113
|
depth: number;
|
|
1114
1114
|
/** Workers with a non-expired heartbeat for this group. */
|
|
1115
1115
|
liveWorkers: WorkerHeartbeat[];
|
|
1116
|
+
/**
|
|
1117
|
+
* Whether this group serves a `@Workflow` body or a `@Step`/handler — route-by-handler gives each
|
|
1118
|
+
* its own queue, so a health list mixes both. Classified by the CONTROL PLANE from its authoritative
|
|
1119
|
+
* registry (`workerHealth()`): a group whose base name is a registered workflow is `'workflow'`,
|
|
1120
|
+
* everything else (in-process steps, remote `handle_*`) is `'step'`. `undefined` only when no
|
|
1121
|
+
* control-plane registry was available to classify (e.g. a transport that reports health with no
|
|
1122
|
+
* engine). Lets a dashboard summarise the fleet in domain terms ("N workflows · M steps") instead of
|
|
1123
|
+
* leaking the raw queue count.
|
|
1124
|
+
*/
|
|
1125
|
+
kind?: 'workflow' | 'step';
|
|
1116
1126
|
}
|
|
1117
1127
|
/**
|
|
1118
1128
|
* The **control plane** — a broadcast pub/sub across ALL engine instances (every pod), separate
|
package/dist/index.d.ts
CHANGED
|
@@ -1113,6 +1113,16 @@ interface GroupHealth {
|
|
|
1113
1113
|
depth: number;
|
|
1114
1114
|
/** Workers with a non-expired heartbeat for this group. */
|
|
1115
1115
|
liveWorkers: WorkerHeartbeat[];
|
|
1116
|
+
/**
|
|
1117
|
+
* Whether this group serves a `@Workflow` body or a `@Step`/handler — route-by-handler gives each
|
|
1118
|
+
* its own queue, so a health list mixes both. Classified by the CONTROL PLANE from its authoritative
|
|
1119
|
+
* registry (`workerHealth()`): a group whose base name is a registered workflow is `'workflow'`,
|
|
1120
|
+
* everything else (in-process steps, remote `handle_*`) is `'step'`. `undefined` only when no
|
|
1121
|
+
* control-plane registry was available to classify (e.g. a transport that reports health with no
|
|
1122
|
+
* engine). Lets a dashboard summarise the fleet in domain terms ("N workflows · M steps") instead of
|
|
1123
|
+
* leaking the raw queue count.
|
|
1124
|
+
*/
|
|
1125
|
+
kind?: 'workflow' | 'step';
|
|
1116
1126
|
}
|
|
1117
1127
|
/**
|
|
1118
1128
|
* The **control plane** — a broadcast pub/sub across ALL engine instances (every pod), separate
|
package/dist/index.js
CHANGED
|
@@ -2879,10 +2879,21 @@ var WorkflowEngine = class {
|
|
|
2879
2879
|
...this.knownGroups(extra),
|
|
2880
2880
|
...await this.pool.listWorkerGroups()
|
|
2881
2881
|
]);
|
|
2882
|
+
const workflowTokens = /* @__PURE__ */ new Set();
|
|
2883
|
+
for (const def of this.workflows.values()) {
|
|
2884
|
+
workflowTokens.add(sanitizeQueueToken(def.name));
|
|
2885
|
+
if (def.remote?.group) workflowTokens.add(def.remote.group);
|
|
2886
|
+
}
|
|
2882
2887
|
const out = [];
|
|
2883
2888
|
for (const group of groups) {
|
|
2884
2889
|
const health = await this.pool.groupHealth(group);
|
|
2885
|
-
if (health)
|
|
2890
|
+
if (!health) continue;
|
|
2891
|
+
const at = group.lastIndexOf("@");
|
|
2892
|
+
const baseToken = at === -1 ? group : group.slice(0, at);
|
|
2893
|
+
out.push({
|
|
2894
|
+
...health,
|
|
2895
|
+
kind: workflowTokens.has(baseToken) ? "workflow" : "step"
|
|
2896
|
+
});
|
|
2886
2897
|
}
|
|
2887
2898
|
return out;
|
|
2888
2899
|
}
|