diff --git a/.changeset/rude-bulldogs-cry.md b/.changeset/rude-bulldogs-cry.md new file mode 100644 index 0000000..dcd1838 --- /dev/null +++ b/.changeset/rude-bulldogs-cry.md @@ -0,0 +1,5 @@ +--- +"@datatruck/cli": patch +--- + +Fix cron process from PM2 diff --git a/packages/cli/src/utils/datatruck/cron-server.ts b/packages/cli/src/utils/datatruck/cron-server.ts index 27d81f4..b24f3b9 100644 --- a/packages/cli/src/utils/datatruck/cron-server.ts +++ b/packages/cli/src/utils/datatruck/cron-server.ts @@ -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}`);