mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Resolve failing checks
This commit is contained in:
parent
1b7ae55ede
commit
2def27dde5
1 changed files with 1 additions and 9 deletions
|
@ -4,7 +4,6 @@ using System.Text.Json.Nodes;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Octobot.Data;
|
using Octobot.Data;
|
||||||
using Remora.Discord.API.Abstractions.Rest;
|
|
||||||
using Remora.Rest.Core;
|
using Remora.Rest.Core;
|
||||||
|
|
||||||
namespace Octobot.Services;
|
namespace Octobot.Services;
|
||||||
|
@ -15,14 +14,12 @@ namespace Octobot.Services;
|
||||||
public sealed class GuildDataService : IHostedService
|
public sealed class GuildDataService : IHostedService
|
||||||
{
|
{
|
||||||
private readonly ConcurrentDictionary<Snowflake, GuildData> _datas = new();
|
private readonly ConcurrentDictionary<Snowflake, GuildData> _datas = new();
|
||||||
private readonly IDiscordRestGuildAPI _guildApi;
|
|
||||||
private readonly ILogger<GuildDataService> _logger;
|
private readonly ILogger<GuildDataService> _logger;
|
||||||
|
|
||||||
// https://github.com/dotnet/aspnetcore/issues/39139
|
// https://github.com/dotnet/aspnetcore/issues/39139
|
||||||
public GuildDataService(
|
public GuildDataService(
|
||||||
IHostApplicationLifetime lifetime, IDiscordRestGuildAPI guildApi, ILogger<GuildDataService> logger)
|
IHostApplicationLifetime lifetime, ILogger<GuildDataService> logger)
|
||||||
{
|
{
|
||||||
_guildApi = guildApi;
|
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
lifetime.ApplicationStopping.Register(ApplicationStopping);
|
lifetime.ApplicationStopping.Register(ApplicationStopping);
|
||||||
}
|
}
|
||||||
|
@ -141,11 +138,6 @@ public sealed class GuildDataService : IHostedService
|
||||||
return (await GetData(guildId, ct)).Settings;
|
return (await GetData(guildId, ct)).Settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<MemberData> GetMemberData(Snowflake guildId, Snowflake userId, CancellationToken ct = default)
|
|
||||||
{
|
|
||||||
return (await GetData(guildId, ct)).GetOrCreateMemberData(userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICollection<Snowflake> GetGuildIds()
|
public ICollection<Snowflake> GetGuildIds()
|
||||||
{
|
{
|
||||||
return _datas.Keys;
|
return _datas.Keys;
|
||||||
|
|
Loading…
Add table
Reference in a new issue