mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
@@ -2,15 +2,15 @@ import { ws } from "./ws.ts";
|
||||
|
||||
/** Allows users to hook in and change to communicate to different clusters across different servers or anything they like. For example using redis pubsub to talk to other servers. */
|
||||
export async function tellClusterToIdentify(
|
||||
workerID: number,
|
||||
shardID: number,
|
||||
bucketID: number,
|
||||
workerId: number,
|
||||
shardId: number,
|
||||
bucketId: number,
|
||||
) {
|
||||
// When resharding this may exist already
|
||||
const oldShard = ws.shards.get(shardID);
|
||||
const oldShard = ws.shards.get(shardId);
|
||||
|
||||
// TODO: Use workers
|
||||
await ws.identify(shardID, ws.maxShards);
|
||||
await ws.identify(shardId, ws.maxShards);
|
||||
|
||||
if (oldShard) {
|
||||
oldShard.ws.close(4009, "Resharded!");
|
||||
|
||||
Reference in New Issue
Block a user