fix: surface pgdata backup read-only blockers
This commit is contained in:
+12
-2
@@ -94,6 +94,10 @@ function dispatchPayload(command: DebugDispatchCommand): Record<string, unknown>
|
||||
return { source: "cli-debug", ...explicit };
|
||||
}
|
||||
|
||||
function resultOk(result: unknown): boolean {
|
||||
return typeof result !== "object" || result === null || !("ok" in result) || (result as { ok?: unknown }).ok !== false;
|
||||
}
|
||||
|
||||
function latestJobId(): string {
|
||||
const jobs = listJobs();
|
||||
if (jobs.length === 0) throw new Error("No jobs found");
|
||||
@@ -238,7 +242,10 @@ async function main(): Promise<void> {
|
||||
}
|
||||
|
||||
if (top === "microservice") {
|
||||
emitJson(commandName, await runMicroserviceCommand(config, args.slice(1)));
|
||||
const result = await runMicroserviceCommand(config, args.slice(1));
|
||||
const ok = resultOk(result);
|
||||
emitJson(commandName, result, ok);
|
||||
if (!ok) process.exitCode = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -261,7 +268,10 @@ async function main(): Promise<void> {
|
||||
}
|
||||
|
||||
if (top === "schedule") {
|
||||
emitJson(commandName, await runScheduleCommand(config, args.slice(1)));
|
||||
const result = await runScheduleCommand(config, args.slice(1));
|
||||
const ok = resultOk(result);
|
||||
emitJson(commandName, result, ok);
|
||||
if (!ok) process.exitCode = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user