#PM2 Configuration File for Sharded bot

7 messages · Page 1 of 1 (latest)

worldly pike
dense stirrup
#

Any ideas?

north raptor
#

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',
    },
  ],
};

The problem is when the main process crashes for some reason, The shards keeps running independently.

worldly pike
#

Why would they? Child processes should stop once their parent is gone, shouldn’t they?