From b9d090d8cfd5656de280dc4fc469a4165210260b Mon Sep 17 00:00:00 2001 From: Ske Date: Tue, 7 Sep 2021 02:21:46 +0200 Subject: [PATCH] Don't hang shard startup for too long --- Myriad/Gateway/Shard.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Myriad/Gateway/Shard.cs b/Myriad/Gateway/Shard.cs index b27b2b96..b2c72442 100644 --- a/Myriad/Gateway/Shard.cs +++ b/Myriad/Gateway/Shard.cs @@ -115,9 +115,9 @@ namespace Myriad.Gateway if (_worker == null) _worker = ShardLoop(); - // we can probably TCS this instead of spin loop but w/e - while (State < ShardState.Identifying) - await Task.Delay(50); + // Ideally we'd stagger the startups so we don't smash the websocket but that's difficult with the + // identify rate limiter so this is the best we can do rn, maybe? + await Task.Delay(200); } public async Task UpdateStatus(GatewayStatusUpdate payload)