chore: format with csharpier
This commit is contained in:
parent
2f516dcb73
commit
4f54077c68
59 changed files with 2000 additions and 942 deletions
|
|
@ -13,7 +13,8 @@ public class GuildFetchService(
|
|||
ILogger logger,
|
||||
ShardedGatewayClient client,
|
||||
IDiscordRestGuildAPI guildApi,
|
||||
IInviteCache inviteCache) : BackgroundService
|
||||
IInviteCache inviteCache
|
||||
) : BackgroundService
|
||||
{
|
||||
private readonly ILogger _logger = logger.ForContext<GuildFetchService>();
|
||||
private readonly ConcurrentQueue<Snowflake> _guilds = new();
|
||||
|
|
@ -23,7 +24,8 @@ public class GuildFetchService(
|
|||
using var timer = new PeriodicTimer(500.Milliseconds());
|
||||
while (await timer.WaitForNextTickAsync(stoppingToken))
|
||||
{
|
||||
if (!_guilds.TryPeek(out var guildId)) continue;
|
||||
if (!_guilds.TryPeek(out var guildId))
|
||||
continue;
|
||||
|
||||
_logger.Debug("Fetching members and invites for guild {GuildId}", guildId);
|
||||
client.ClientFor(guildId).SubmitCommand(new RequestGuildMembers(guildId, "", 0));
|
||||
|
|
@ -43,6 +45,7 @@ public class GuildFetchService(
|
|||
|
||||
public void EnqueueGuild(Snowflake guildId)
|
||||
{
|
||||
if (!_guilds.Contains(guildId)) _guilds.Enqueue(guildId);
|
||||
if (!_guilds.Contains(guildId))
|
||||
_guilds.Enqueue(guildId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue