From 1c184825e3523824df35551992cea451ba53bdc2 Mon Sep 17 00:00:00 2001 From: Ske Date: Mon, 23 Dec 2019 18:36:56 +0100 Subject: [PATCH] Use fork of D.NET to potentially resolve issues --- .gitmodules | 3 +++ Discord.Net | 1 + PluralKit.Bot/Bot.cs | 4 ++-- PluralKit.Bot/PluralKit.Bot.csproj | 2 +- PluralKit.sln | 18 ++++++++++++++++++ 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .gitmodules create mode 160000 Discord.Net diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..5e9cfa0b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Discord.Net"] + path = Discord.Net + url = https://github.com/xSke/Discord.Net diff --git a/Discord.Net b/Discord.Net new file mode 160000 index 00000000..2aaa5e7c --- /dev/null +++ b/Discord.Net @@ -0,0 +1 @@ +Subproject commit 2aaa5e7ce50f056969e4b000386fc9bc336880a5 diff --git a/PluralKit.Bot/Bot.cs b/PluralKit.Bot/Bot.cs index e337f2a5..cdd775af 100644 --- a/PluralKit.Bot/Bot.cs +++ b/PluralKit.Bot/Bot.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Net.Http; using System.Threading; @@ -89,7 +90,7 @@ namespace PluralKit.Bot ConnectionTimeout = 2*60*1000, ExclusiveBulkDelete = true, 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 // 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) @@ -307,7 +308,6 @@ namespace PluralKit.Bot 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 - _logger.Debug("ThreadPool pending count: {PendingCount}, completed: {CompletedCount}, {ThreadCount} threads", ThreadPool.PendingWorkItemCount, ThreadPool.CompletedWorkItemCount, ThreadPool.ThreadCount); RegisterMessageMetrics(arg); diff --git a/PluralKit.Bot/PluralKit.Bot.csproj b/PluralKit.Bot/PluralKit.Bot.csproj index 3a07f667..8df75263 100644 --- a/PluralKit.Bot/PluralKit.Bot.csproj +++ b/PluralKit.Bot/PluralKit.Bot.csproj @@ -6,11 +6,11 @@ + - diff --git a/PluralKit.sln b/PluralKit.sln index c33f65c8..bcea86e3 100644 --- a/PluralKit.sln +++ b/PluralKit.sln @@ -6,6 +6,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluralKit.Core", "PluralKit EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluralKit.API", "PluralKit.API\PluralKit.API.csproj", "{3420F8A9-125C-4F7F-A444-10DD16945754}" 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 GlobalSection(SolutionConfigurationPlatforms) = preSolution 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}.Release|Any CPU.ActiveCfg = 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 EndGlobal