mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
- Moved update loop to a separate method.
- Added optimize flag to GlobalNadeko configuration. - Added some packages which will be needed soon
This commit is contained in:
@@ -121,13 +121,16 @@ public class XpService : INService, IReadyExecutor
|
||||
#endif
|
||||
}
|
||||
|
||||
public Task OnReadyAsync()
|
||||
=> UpdateLoop();
|
||||
|
||||
private async Task UpdateLoop()
|
||||
public async Task OnReadyAsync()
|
||||
{
|
||||
using var timer = new PeriodicTimer(5.Seconds());
|
||||
while (await timer.WaitForNextTickAsync())
|
||||
{
|
||||
await UpdateLoop();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateLoop()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -143,7 +146,7 @@ public class XpService : INService, IReadyExecutor
|
||||
|
||||
var group = toAddTo.GroupBy(x => (GuildId: x.Guild.Id, x.User));
|
||||
if (toAddTo.Count == 0)
|
||||
continue;
|
||||
return;
|
||||
|
||||
await using (var uow = _db.GetDbContext())
|
||||
{
|
||||
@@ -269,7 +272,6 @@ public class XpService : INService, IReadyExecutor
|
||||
Log.Error(ex, "Error In the XP update loop");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void InternalReloadXpTemplate()
|
||||
|
@@ -35,12 +35,6 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Html2Markdown" Version="5.0.2.561" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
|
||||
@@ -59,10 +53,22 @@
|
||||
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta0010" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.2.88" />
|
||||
<PackageReference Include="YamlDotNet" Version="11.2.1" />
|
||||
<PackageReference Include="linq2db.EntityFrameworkCore" Version="6.6.1" />
|
||||
<PackageReference Include="Humanizer" Version="2.14.1" />
|
||||
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" />
|
||||
|
||||
<!-- Db-related packages -->
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
<PackageReference Include="linq2db.EntityFrameworkCore" Version="6.6.1" />
|
||||
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.2" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.3" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
|
||||
|
||||
<!-- Remove this when static abstract interface members support is released -->
|
||||
<PackageReference Include="System.Runtime.Experimental" Version="6.0.0" />
|
||||
|
||||
@@ -105,6 +111,9 @@
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'GlobalNadeko' ">
|
||||
<DefineConstants>$(DefineConstants);GLOBAL_NADEKO</DefineConstants>
|
||||
<NoWarn>$(NoWarn);CS1573;CS1591</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>portable</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- TODO: Remove this when the conflict issue in System.Runtime.Experimental is fixed -->
|
||||
|
Reference in New Issue
Block a user