fix: 修复 control-plane status 长时无输出
This commit is contained in:
@@ -42,6 +42,7 @@ import { runNodeEndpointBridge } from "./secret-scripts";
|
||||
import { nodeRuntimeSourceWorkspaceCommand } from "./source-workspace";
|
||||
import { nodeRuntimeGitMirrorRun, nodeRuntimeGitMirrorStatus, nodeScopedFullOutput, withNodeRuntimeGitMirrorRendered } from "./status";
|
||||
import { assertNodeId, positiveIntegerOption, requiredOption } from "./utils";
|
||||
import { emitNodeRuntimeStatusWorkerEvent, isNodeRuntimeStatusWorker, readNodeRuntimeStatusPolicy, runObservedNodeRuntimeStatus } from "./control-plane-status-observed";
|
||||
import { legacyHwlabNodeWebProbeUnsupported } from "../web-probe";
|
||||
import { startNodeDelegatedJob } from "./web-probe";
|
||||
import { assertKnownOptions } from "./web-probe-observe";
|
||||
@@ -639,10 +640,17 @@ export async function runNodeDelegatedDomain(config: Config, domain: DelegatedNo
|
||||
}
|
||||
if (domain === "control-plane") {
|
||||
if (scoped.action === "status") {
|
||||
const result = nodeRuntimeControlPlaneStatus(scoped);
|
||||
if (scoped.originalArgs.includes("--raw")) return result;
|
||||
if (scoped.originalArgs.includes("--full")) return withNodeRuntimeControlPlaneStatusFullRendered(result, scoped);
|
||||
return withNodeRuntimeControlPlaneStatusRendered(result, scoped);
|
||||
if (isNodeRuntimeStatusWorker()) {
|
||||
return nodeRuntimeControlPlaneStatus(scoped, {
|
||||
policy: readNodeRuntimeStatusPolicy(),
|
||||
onProgress: emitNodeRuntimeStatusWorkerEvent,
|
||||
});
|
||||
}
|
||||
const observed = await runObservedNodeRuntimeStatus(scoped);
|
||||
if (scoped.originalArgs.includes("--raw")) return observed.full;
|
||||
if (scoped.originalArgs.includes("--json")) return observed.summary;
|
||||
if (scoped.originalArgs.includes("--full")) return withNodeRuntimeControlPlaneStatusFullRendered(observed.full, scoped);
|
||||
return withNodeRuntimeControlPlaneStatusRendered(observed.summary, scoped);
|
||||
}
|
||||
if (scoped.action === "apply" || scoped.action === "trigger-current" || scoped.action === "refresh" || scoped.action === "sync" || scoped.action === "runtime-migration" || scoped.action === "cleanup-runs" || scoped.action === "cleanup-released-pvs" || scoped.action === "cleanup-legacy-docker-images" || scoped.action === "cleanup-legacy-docker-registry-volume") {
|
||||
if (scoped.confirm && !scoped.dryRun && !scoped.wait) return startNodeDelegatedJob(scoped);
|
||||
|
||||
Reference in New Issue
Block a user