I use pm2 to run the service. I have a total of 2 clusters.
And I created a schedule job in nestjs and executed the schedule,
but both clusters ran schedule and the database was locked.
how can i avoid this?
below is my ecosystem.js
module.exports = {
apps: [
{
name: 'my_app',
script: 'dist/main.js',
instances: 0,
exec_mode: 'cluster',
listen_timeout: 10000,
kill_timeout: 1000,
},
],
};