mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-22 07:43:08 +02:00
feat: internal sharding
This commit is contained in:
parent
dbd45da7ad
commit
7a131e7936
@ -34,6 +34,7 @@ module.exports = class Client extends FrameworkClient {
|
||||
Partials.Message,
|
||||
Partials.Reaction,
|
||||
],
|
||||
shards: 'auto',
|
||||
},
|
||||
{ baseDir: __dirname },
|
||||
);
|
||||
|
@ -31,7 +31,7 @@ module.exports = class extends Listener {
|
||||
|
||||
// process.title = `"[Discord Tickets] ${client.user.tag}"`; // too long and gets cut off
|
||||
process.title = 'tickets';
|
||||
client.log.success('Connected to Discord as "%s"', client.user.tag);
|
||||
client.log.success('Connected to Discord as "%s" over %d shards', client.user.tag, client.ws.shards.size);
|
||||
|
||||
// fill cache
|
||||
await sync(client);
|
||||
|
@ -1,6 +1,16 @@
|
||||
module.exports.get = () => ({
|
||||
handler: async (req, res) => {
|
||||
const { status } = req.routeOptions.config.client.ws;
|
||||
res.code(status === 0 ? 200 : 503).send(status);
|
||||
const { client } = req.routeOptions.config;
|
||||
res
|
||||
.code(client.ws.status === 0 ? 200 : 503)
|
||||
.send({
|
||||
ping: client.ws.ping,
|
||||
shards: client.ws.shards.map(shard => ({
|
||||
id: shard.id,
|
||||
ping: shard.ping,
|
||||
status: shard.status,
|
||||
})),
|
||||
status: client.ws.status,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user