mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-03 20:49:54 +03:00
Fix a critical performance issue in GuildData, skip guild ticks if running behind
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
1c13f0a310
commit
eaeacc1206
3 changed files with 3 additions and 3 deletions
|
@ -23,7 +23,7 @@ public static class Boyfriend {
|
|||
};
|
||||
|
||||
private static DateTimeOffset _nextSongAt = DateTimeOffset.MinValue;
|
||||
private static uint _nextSongIndex;
|
||||
private static uint _nextSongIndex;
|
||||
|
||||
private static readonly Tuple<Game, TimeSpan>[] ActivityList = {
|
||||
Tuple.Create(
|
||||
|
@ -72,6 +72,8 @@ public static class Boyfriend {
|
|||
}
|
||||
|
||||
private static async void TickAllGuildsAsync(object? sender, ElapsedEventArgs e) {
|
||||
if (GuildTickTasks.Count is not 0) return;
|
||||
|
||||
foreach (var guild in Client.Guilds) GuildTickTasks.Add(TickGuildAsync(guild));
|
||||
|
||||
try { Task.WaitAll(GuildTickTasks.ToArray()); } catch (AggregateException ex) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue