mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 05:42:57 -04:00
improve startup logging
This commit is contained in:
parent
934f6ec09f
commit
b049aefad2
2 changed files with 6 additions and 15 deletions
14
index.js
14
index.js
|
@ -35,16 +35,6 @@ const manager = new ClusterManager(client, token, {
|
|||
})
|
||||
|
||||
await manager.run();
|
||||
console.log(`[${process.env.HOSTNAME || "labscore"}] bot ready. took ${(Date.now() - time) / 1000}.`)
|
||||
|
||||
// This is kind of a hack.
|
||||
// Our current deployment system has a tendency to launch the bot twice, this "ensures" that
|
||||
// incorrect instances close again. This should *probably* just be moved to dirigent instead.
|
||||
if(process.env.PB_MANAGER_HOST){
|
||||
let liveDeploy = await superagent.get(`${process.env.PB_MANAGER_HOST}_pbs/v1/GetPbServiceId`)
|
||||
if(process.env.HOSTNAME !== liveDeploy.body.d){
|
||||
console.log(`[${process.env.HOSTNAME}] invalid deployment session`)
|
||||
process.exit();
|
||||
}
|
||||
}
|
||||
console.log(`[${process.env.HOSTNAME || "labscore"}] bot ready (${Date.now() - time}ms)`)
|
||||
console.log(`[${process.env.HOSTNAME || "labscore"}] manager running shards ${manager.shardStart}-${manager.shardEnd} (${manager.shardCount})`);
|
||||
})();
|
|
@ -241,24 +241,25 @@ interactionClient.on('commandRunError', async ({context, error}) => {
|
|||
});
|
||||
|
||||
try{
|
||||
let clusterTimings = Date.now();
|
||||
// TODO: This should in theory already be done by detritus, figure out why it isn't
|
||||
await cluster.run().then();
|
||||
|
||||
console.log(`[${process.env.HOSTNAME || "labscore"}]{${cluster.clusterId}} cluster ran`)
|
||||
console.log(`[${process.env.HOSTNAME || "labscore"}]{${cluster.clusterId}} cluster ran (${Date.now() - clusterTimings}ms)`)
|
||||
let shards = `{${cluster.clusterId}} (${cluster.shards.map((shard) => shard.shardId).join(', ') })`;
|
||||
console.log(`[${process.env.HOSTNAME || "labscore"}]${shards} shards loaded`)
|
||||
|
||||
{
|
||||
await commandClient.addMultipleIn('../commands/message/');
|
||||
await commandClient.run()
|
||||
console.log(`[${process.env.HOSTNAME || "labscore"}]${shards} command client ready`)
|
||||
console.log(`[${process.env.HOSTNAME || "labscore"}]${shards} command client ready (${Date.now() - clusterTimings}ms)`)
|
||||
}
|
||||
{
|
||||
await interactionClient.addMultipleIn('../commands/interaction/context');
|
||||
await interactionClient.addMultipleIn('../commands/interaction/user');
|
||||
await interactionClient.addMultipleIn('../commands/interaction/slash');
|
||||
await interactionClient.run();
|
||||
console.log(`[${process.env.HOSTNAME || "labscore"}]${shards} interaction command client ready`)
|
||||
console.log(`[${process.env.HOSTNAME || "labscore"}]${shards} interaction command client ready (${Date.now() - clusterTimings}ms)`)
|
||||
}
|
||||
} catch(e){
|
||||
console.log(e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue