Skip to content

Commit

Permalink
fix(cli): try use the original bin path
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrgm committed Feb 6, 2024
1 parent 38c2bec commit 87c245c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rude-bulldogs-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@datatruck/cli": patch
---

Fix cron process from PM2
8 changes: 7 additions & 1 deletion packages/cli/src/utils/datatruck/cron-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ export function createCronServer(
const [node, bin] = process.argv;
await AsyncProcess.exec(
node,
[bin, "-c", config.configPath, action.name, ...cliOptions],
[
process.env.pm_exec_path ?? bin,
"-c",
config.configPath,
action.name,
...cliOptions,
],
{ $log: config.verbose },
);
if (config.log) console.info(`< [job] ${index} - ${action.name}`);
Expand Down

0 comments on commit 87c245c

Please sign in to comment.