pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

Can I have results from the script ?

Open sytolk opened this issue 2 years ago • 1 comments

I needs to execute in Electron heavy process that generate thumbnails but how to get results (maybe in pid object) after execution of script succeed?

createThumbnailsInWorker = (tmbGenerationList: Array<string>): Promise<any> =>
new Promise((resolve, reject) => {
   pm2.start(
        {
          script: 'generatethumbs.js', // Script to be run
          cwd: 'app/node_modules/tagspaces-workers',
          args: ['-p false', ...tmbGenerationList],
        },
        (err, pid) => {
          if(err) {
            reject(new Error('createThumbnailsInWorker crashed'));
          }
          resolve(pid.tmbGenerationPaths); // -> I'm expecting to get results like that
        }
      );
}

sytolk avatar Aug 09 '21 14:08 sytolk