From 85f694ba7d7c1eb5363738ed6c88ee7a46306508 Mon Sep 17 00:00:00 2001 From: Noikoio Date: Sun, 27 Aug 2017 18:34:22 -0700 Subject: [PATCH] AutoMod rule processing to the thread pool It was originally like that, but was changed to be synchronous during debugging. I may have forgotten to revert it before committing. Also, removed note for future asynchronous response processing. Synchronous response execution is expected behavior at this point. --- Feature/AutoMod/AutoMod.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Feature/AutoMod/AutoMod.cs b/Feature/AutoMod/AutoMod.cs index 2b2588d..a8cf37e 100644 --- a/Feature/AutoMod/AutoMod.cs +++ b/Feature/AutoMod/AutoMod.cs @@ -58,10 +58,9 @@ namespace Noikoio.RegexBot.Feature.AutoMod foreach (var rule in rules) { - // Checking for mod bypass here (Rule doesn't have access to mod list) + // Checking for mod bypass here (Rule.Match isn't able to access mod list) bool isMod = IsModerator(ch.Guild.Id, m); - //await Task.Run(async () => await ProcessMessage(m, rule, isMod)); - await ProcessMessage(m, rule, isMod); + await Task.Run(async () => await ProcessMessage(m, rule, isMod)); } } @@ -77,7 +76,6 @@ namespace Noikoio.RegexBot.Feature.AutoMod foreach (Response resp in r.Response) { - // TODO foreach await (when that becomes available) try { await resp.Invoke(m);