fix extracting enabled library list

limit simultaneous log parsing to half the cores instead of N-1
This commit is contained in:
13xforever
2018-08-10 13:05:48 +05:00
committed by Roberto Anić Banić
parent 6f70baf0bf
commit 7ffd507b5e
2 changed files with 4 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ namespace CompatBot.EventHandlers
new ZipHandler(),
};
private static readonly SemaphoreSlim QueueLimiter = new SemaphoreSlim(Math.Max(1, Environment.ProcessorCount-1), Math.Max(1, Environment.ProcessorCount - 1));
private static readonly SemaphoreSlim QueueLimiter = new SemaphoreSlim(Math.Max(1, Environment.ProcessorCount / 2), Math.Max(1, Environment.ProcessorCount / 2));
private delegate void OnLog(MessageCreateEventArgs args);
private static event OnLog OnNewLog;

View File

@@ -11,6 +11,7 @@ namespace CompatBot.EventHandlers.LogParsing
internal partial class LogParser
{
private const RegexOptions DefaultOptions = RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.ExplicitCapture;
private const RegexOptions DefaultSingleLineOptions = RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture;
/*
* Extractors are defined in terms of trigger-extractor
@@ -29,7 +30,7 @@ namespace CompatBot.EventHandlers.LogParsing
{
Extractors = new Dictionary<string, Regex>
{
["RPCS3"] = new Regex(@"(?<build_and_specs>.*)\r?$", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture),
["RPCS3"] = new Regex(@"(?<build_and_specs>.*)\r?$", DefaultSingleLineOptions),
},
EndTrigger = "·",
},
@@ -59,7 +60,7 @@ namespace CompatBot.EventHandlers.LogParsing
["loop detection:"] = new Regex("detection: (?<spu_loop_detection>.*?)\r?$", DefaultOptions),
["Lib Loader:"] = new Regex("[Ll]oader: (?<lib_loader>.*?)\r?$", DefaultOptions),
["static functions:"] = new Regex("functions: (?<hook_static_functions>.*?)\r?$", DefaultOptions),
["Load libraries:"] = new Regex("libraries: (?<library_list>.*)", DefaultOptions),
["Load libraries:"] = new Regex("libraries:(?<library_list>.*?)$", DefaultSingleLineOptions),
},
EndTrigger = "VFS:",
},