Use fork of D.NET to potentially resolve issues

This commit is contained in:
Ske 2019-12-23 18:36:56 +01:00
parent 6a4c131d6d
commit 1c184825e3
5 changed files with 25 additions and 3 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "Discord.Net"]
path = Discord.Net
url = https://github.com/xSke/Discord.Net

1
Discord.Net Submodule

@ -0,0 +1 @@
Subproject commit 2aaa5e7ce50f056969e4b000386fc9bc336880a5

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Threading; using System.Threading;
@ -89,7 +90,7 @@ namespace PluralKit.Bot
ConnectionTimeout = 2*60*1000, ConnectionTimeout = 2*60*1000,
ExclusiveBulkDelete = true, ExclusiveBulkDelete = true,
LargeThreshold = 50, LargeThreshold = 50,
DefaultRetryMode = RetryMode.AlwaysFail DefaultRetryMode = RetryMode.RetryTimeouts | RetryMode.RetryRatelimit
// Commented this out since Debug actually sends, uh, quite a lot that's not necessary in production // Commented this out since Debug actually sends, uh, quite a lot that's not necessary in production
// but leaving it here in case I (or someone else) get[s] confused about why logging isn't working again :p // but leaving it here in case I (or someone else) get[s] confused about why logging isn't working again :p
// LogLevel = LogSeverity.Debug // We filter log levels in Serilog, so just pass everything through (Debug is lower than Verbose) // LogLevel = LogSeverity.Debug // We filter log levels in Serilog, so just pass everything through (Debug is lower than Verbose)
@ -307,7 +308,6 @@ namespace PluralKit.Bot
if (_client.GetShardFor((arg.Channel as IGuildChannel)?.Guild).ConnectionState != ConnectionState.Connected) if (_client.GetShardFor((arg.Channel as IGuildChannel)?.Guild).ConnectionState != ConnectionState.Connected)
return; // Discard messages while the bot "catches up" to avoid unnecessary CPU pressure causing timeouts return; // Discard messages while the bot "catches up" to avoid unnecessary CPU pressure causing timeouts
_logger.Debug("ThreadPool pending count: {PendingCount}, completed: {CompletedCount}, {ThreadCount} threads", ThreadPool.PendingWorkItemCount, ThreadPool.CompletedWorkItemCount, ThreadPool.ThreadCount);
RegisterMessageMetrics(arg); RegisterMessageMetrics(arg);

View File

@ -6,11 +6,11 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Discord.Net\src\Discord.Net.WebSocket\Discord.Net.WebSocket.csproj" />
<ProjectReference Include="..\PluralKit.Core\PluralKit.Core.csproj" /> <ProjectReference Include="..\PluralKit.Core\PluralKit.Core.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Discord.Net.WebSocket" Version="2.1.1" />
<PackageReference Include="Humanizer.Core" Version="2.7.9" /> <PackageReference Include="Humanizer.Core" Version="2.7.9" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />

View File

@ -6,6 +6,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluralKit.Core", "PluralKit
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluralKit.API", "PluralKit.API\PluralKit.API.csproj", "{3420F8A9-125C-4F7F-A444-10DD16945754}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluralKit.API", "PluralKit.API\PluralKit.API.csproj", "{3420F8A9-125C-4F7F-A444-10DD16945754}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Discord.Net.WebSocket", "Discord.Net\src\Discord.Net.WebSocket\Discord.Net.WebSocket.csproj", "{5FE544F8-310F-410A-8590-7B78469B5B9C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Discord.Net.Core", "Discord.Net\src\Discord.Net.Core\Discord.Net.Core.csproj", "{D6376AC6-9BE4-49CE-99CD-061879B400D4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Discord.Net.Rest", "Discord.Net\src\Discord.Net.Rest\Discord.Net.Rest.csproj", "{4723EEE6-322B-41A1-BD89-03219E181E38}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -24,5 +30,17 @@ Global
{3420F8A9-125C-4F7F-A444-10DD16945754}.Debug|Any CPU.Build.0 = Debug|Any CPU {3420F8A9-125C-4F7F-A444-10DD16945754}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3420F8A9-125C-4F7F-A444-10DD16945754}.Release|Any CPU.ActiveCfg = Release|Any CPU {3420F8A9-125C-4F7F-A444-10DD16945754}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3420F8A9-125C-4F7F-A444-10DD16945754}.Release|Any CPU.Build.0 = Release|Any CPU {3420F8A9-125C-4F7F-A444-10DD16945754}.Release|Any CPU.Build.0 = Release|Any CPU
{5FE544F8-310F-410A-8590-7B78469B5B9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5FE544F8-310F-410A-8590-7B78469B5B9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FE544F8-310F-410A-8590-7B78469B5B9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FE544F8-310F-410A-8590-7B78469B5B9C}.Release|Any CPU.Build.0 = Release|Any CPU
{D6376AC6-9BE4-49CE-99CD-061879B400D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D6376AC6-9BE4-49CE-99CD-061879B400D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D6376AC6-9BE4-49CE-99CD-061879B400D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D6376AC6-9BE4-49CE-99CD-061879B400D4}.Release|Any CPU.Build.0 = Release|Any CPU
{4723EEE6-322B-41A1-BD89-03219E181E38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4723EEE6-322B-41A1-BD89-03219E181E38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4723EEE6-322B-41A1-BD89-03219E181E38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4723EEE6-322B-41A1-BD89-03219E181E38}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal