oh god help

This commit is contained in:
Essem 2022-10-31 12:49:19 -05:00
parent 5281cb1fd7
commit b098499c67
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
2 changed files with 25 additions and 19 deletions

View file

@ -31,6 +31,8 @@ export default async (client) => {
activityChanger(client);
ready = true;
process.send("ready");
logger.log("info", "Started esmBot.");
};

View file

@ -223,23 +223,27 @@ function calcShards(shards, procs) {
}
const shardArrays = calcShards(shardArray, procAmount);
pm2.start({
name: "esmBot",
script: "app.js",
autorestart: true,
exp_backoff_restart_delay: 1000,
watch: false,
exec_mode: "cluster",
instances: shardArrays.length,
env: {
"SHARDS": JSON.stringify(shardArrays)
}
}, (err) => {
if (err) {
logger.error(`Failed to start esmBot: ${err}`);
process.exit(0);
} else {
logger.info("Started esmBot processes.");
}
});
for (let i = 0; i < shardArrays.length; i++) {
pm2.start({
name: "esmBot",
script: "app.js",
autorestart: true,
exp_backoff_restart_delay: 1000,
wait_ready: true,
listen_timeout: 60000,
watch: false,
exec_mode: "cluster",
instances: 1,
env: {
"SHARDS": JSON.stringify(shardArrays)
}
}, (err) => {
if (err) {
logger.error(`Failed to start esmBot process ${i}: ${err}`);
process.exit(0);
} else {
logger.info(`Started esmBot process ${i}.`);
}
});
}
})();