mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-10 16:05:58 +00:00
fix(typescript-client): runFlowAsync by default assume job doesn't outlive flow
This commit is contained in:
@@ -134,7 +134,7 @@ export async function runFlow(
|
||||
console.info(`running \`${path}\` synchronously with args:`, args);
|
||||
}
|
||||
|
||||
const jobId = await runFlowAsync(path, args);
|
||||
const jobId = await runFlowAsync(path, args, null, true);
|
||||
return await waitJob(jobId, verbose);
|
||||
}
|
||||
|
||||
@@ -272,7 +272,8 @@ export async function runScriptAsync(
|
||||
export async function runFlowAsync(
|
||||
path: string | null,
|
||||
args: Record<string, any> | null,
|
||||
scheduledInSeconds: number | null = null
|
||||
scheduledInSeconds: number | null = null,
|
||||
flowOutlivesParent: boolean = false
|
||||
): Promise<string> {
|
||||
// Create a script job and return its job id.
|
||||
|
||||
@@ -283,9 +284,11 @@ export async function runFlowAsync(
|
||||
params["scheduled_in_secs"] = scheduledInSeconds;
|
||||
}
|
||||
|
||||
let parentJobId = getEnv("WM_JOB_ID");
|
||||
if (parentJobId !== undefined) {
|
||||
params["parent_job"] = parentJobId;
|
||||
if (flowOutlivesParent) {
|
||||
let parentJobId = getEnv("WM_JOB_ID");
|
||||
if (parentJobId !== undefined) {
|
||||
params["parent_job"] = parentJobId;
|
||||
}
|
||||
}
|
||||
|
||||
let rootJobId = getEnv("WM_ROOT_FLOW_JOB_ID");
|
||||
|
||||
Reference in New Issue
Block a user