fix: invalid sessions should identify through manager

This commit is contained in:
Skillz
2023-03-12 16:22:29 -05:00
parent 3d12ce2853
commit 6ec631f42b
2 changed files with 2 additions and 6 deletions
+1 -4
View File
@@ -172,9 +172,6 @@ export class DiscordenoShard {
await this.connect()
}
// Wait until an identify is free for this this.
await this.requestIdentify()
this.send(
{
op: GatewayOpcodes.Identify,
@@ -426,7 +423,7 @@ export class DiscordenoShard {
// When resumable is false we need to re-identify
if (!resumable) {
await this.identify()
await this.requestIdentify()
break
}
+1 -2
View File
@@ -164,8 +164,7 @@ export function createGatewayManager(options: CreateGatewayManagerOptions): Gate
},
events: options.events,
requestIdentify: async () => {
// TODO: remove this entire concept, its much easier to do in reality.
// await gateway.buckets.get(shardId % gateway.connection.sessionStartLimit.maxConcurrency)!.leak.acquire(shardId)
return await gateway.identify(shardId);
},
shardIsReady: async () => {
logger.debug(`[Shard] Shard #${shardId} is ready`)