Accelerate initial bots startup

Files can be read in parallel after all
This commit is contained in:
JustArchi
2018-05-13 19:19:27 +02:00
parent db3cfbe7d2
commit cbfc7d0e42
7 changed files with 75 additions and 41 deletions

View File

@@ -162,7 +162,7 @@ namespace ArchiSteamFarm {
public bool ShouldSerializeSteamParentalPIN() => ShouldSerializeSensitiveDetails;
public bool ShouldSerializeSteamPassword() => ShouldSerializeSensitiveDetails;
internal static BotConfig Load(string filePath) {
internal static async Task<BotConfig> Load(string filePath) {
if (string.IsNullOrEmpty(filePath)) {
ASF.ArchiLogger.LogNullError(nameof(filePath));
return null;
@@ -175,7 +175,7 @@ namespace ArchiSteamFarm {
BotConfig botConfig;
try {
botConfig = JsonConvert.DeserializeObject<BotConfig>(File.ReadAllText(filePath));
botConfig = JsonConvert.DeserializeObject<BotConfig>(await File.ReadAllTextAsync(filePath).ConfigureAwait(false));
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);
return null;