fix: don't change status in test mode, fix broken guilds query
This commit is contained in:
parent
87b3281c8d
commit
ae4d9018ea
2 changed files with 9 additions and 3 deletions
|
|
@ -20,7 +20,7 @@ using Remora.Discord.API.Objects;
|
|||
|
||||
namespace Catalogger.Backend.Services;
|
||||
|
||||
public class StatusUpdateService(ILogger logger, ShardedGatewayClient shardedClient)
|
||||
public class StatusUpdateService(ILogger logger, ShardedGatewayClient shardedClient, Config config)
|
||||
: BackgroundService
|
||||
{
|
||||
private readonly ILogger _logger = logger.ForContext<StatusUpdateService>();
|
||||
|
|
@ -40,6 +40,12 @@ public class StatusUpdateService(ILogger logger, ShardedGatewayClient shardedCli
|
|||
CataloggerMetrics.GuildsCached.Value
|
||||
);
|
||||
|
||||
if (config.Discord.TestMode)
|
||||
{
|
||||
_logger.Debug("Not updating shard statuses because test mode is enabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var (shardId, client) in shardedClient.Shards)
|
||||
{
|
||||
if (!ShardedGatewayClient.IsConnected(client))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue