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.
This commit is contained in:
Noikoio 2017-08-27 18:34:22 -07:00
parent 3c88bce94a
commit 85f694ba7d

View file

@ -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);