I’ve been messing with the baremetal deploys for a few months now and I really like it. I however have an issue.
If I deploy yarn rw deploy baremetal production
I cannot seem to get the background jobs to start.
I’ve been following the Advanced Job Workers and trying to match that up with the ecosystem.js
I’ve tried a number of configurations and tried this with the first-run option to get these running…I mentioned it in Esteban’s BareMetal Cheat sheet
module.exports = {
apps: [
/* { name: 'api', },*/// not relevant here
{ //adv. job test
name: 'job',
cwd: 'current',
script: 'node_modules/.bin/rw-jobs-worker',
args: '--index=0 --id=0',
instances: 'max',
exec_mode: 'cluster',
wait_ready: true,
listen_timeout: 10000,
},
{//esteban suggested this, but it didnt start it
name: 'bg-jobs',
cwd: 'current',
script: 'node_modules/.bin/rw',
args: 'jobs start',
instances: 'max',
exec_mode: 'cluster',
wait_ready: true,
listen_timeout: 10000,
},
],
}
My workaround is to do the deploy, then ssh to the machine, cd into the /var/www/project/current and run yarn rw jobs start
This works until the current symlinked direcotry gets dropped, but really i need to reboot the server and restart the job. I had it working with pm2, but the runner was tied to the … dated directory and not current.
Anyone have any ideas on how to get these background jobs to start and restart with baremetal deploys?