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

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