oh god help
This commit is contained in:
parent
5281cb1fd7
commit
b098499c67
2 changed files with 25 additions and 19 deletions
|
@ -31,6 +31,8 @@ export default async (client) => {
|
||||||
activityChanger(client);
|
activityChanger(client);
|
||||||
|
|
||||||
ready = true;
|
ready = true;
|
||||||
|
|
||||||
|
process.send("ready");
|
||||||
|
|
||||||
logger.log("info", "Started esmBot.");
|
logger.log("info", "Started esmBot.");
|
||||||
};
|
};
|
|
@ -223,23 +223,27 @@ function calcShards(shards, procs) {
|
||||||
}
|
}
|
||||||
const shardArrays = calcShards(shardArray, procAmount);
|
const shardArrays = calcShards(shardArray, procAmount);
|
||||||
|
|
||||||
pm2.start({
|
for (let i = 0; i < shardArrays.length; i++) {
|
||||||
name: "esmBot",
|
pm2.start({
|
||||||
script: "app.js",
|
name: "esmBot",
|
||||||
autorestart: true,
|
script: "app.js",
|
||||||
exp_backoff_restart_delay: 1000,
|
autorestart: true,
|
||||||
watch: false,
|
exp_backoff_restart_delay: 1000,
|
||||||
exec_mode: "cluster",
|
wait_ready: true,
|
||||||
instances: shardArrays.length,
|
listen_timeout: 60000,
|
||||||
env: {
|
watch: false,
|
||||||
"SHARDS": JSON.stringify(shardArrays)
|
exec_mode: "cluster",
|
||||||
}
|
instances: 1,
|
||||||
}, (err) => {
|
env: {
|
||||||
if (err) {
|
"SHARDS": JSON.stringify(shardArrays)
|
||||||
logger.error(`Failed to start esmBot: ${err}`);
|
}
|
||||||
process.exit(0);
|
}, (err) => {
|
||||||
} else {
|
if (err) {
|
||||||
logger.info("Started esmBot processes.");
|
logger.error(`Failed to start esmBot process ${i}: ${err}`);
|
||||||
}
|
process.exit(0);
|
||||||
});
|
} else {
|
||||||
|
logger.info(`Started esmBot process ${i}.`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
})();
|
})();
|
Loading…
Reference in a new issue