Skip to content

Commit

Permalink
fix(cli): delay exit
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrgm committed Apr 10, 2024
1 parent b7c723d commit 04f9cdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/commands/RunCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ export class RunCommand extends CommandAbstract<typeof runCommandOptions> {
return { exitCode: 1 };
}

await runJob(job, jobName, {
const exitCode = await runJob(job, jobName, {
verbose: verbose,
configPath: config.path!,
});

return { exitCode: 0 };
return { exitCode };
}
}
4 changes: 1 addition & 3 deletions packages/cli/src/utils/datatruck/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export async function runJob(
const cliOptions = getJobCliOptions(job);
const [node, bin] = process.argv;

const exitCode = await AsyncProcess.exec(
return await AsyncProcess.exec(
node,
[
process.env.DTT_BIN_SCRIPT ?? process.env.pm_exec_path ?? bin,
Expand All @@ -103,8 +103,6 @@ export async function runJob(
stdio: "inherit",
},
);

process.exit(exitCode);
}

export async function runCronJob(job: Job, name: string, config: JobConfig) {
Expand Down

0 comments on commit 04f9cdf

Please sign in to comment.