PM2 Configuration File for Sharded bot

How can I create an auto restart config in PM2 for Sharded bot? Will this work?
module.exports = {
apps: [
{
name: 'bot',
script: './index.js',
args: '--color',
node_args: '--max_old_space_size=12000',
max_memory_restart: '10G',
},
],
};
module.exports = {
apps: [
{
name: 'bot',
script: './index.js',
args: '--color',
node_args: '--max_old_space_size=12000',
max_memory_restart: '10G',
},
],
};
The problem is when the main process crashes for some reason, The shards keeps running independently.
2 Replies
Arypton
Arypton13mo ago
well that's new <:ducktea_001:1150813718029021205>
dzlandis
dzlandis13mo ago
I actually have a similar problem that occurs on a bot crash where I get stagnant leftover shard processes. Any ideas?
Want results from more Discord servers?
Add your server