mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-13 15:10:36 +00:00
Accelerate initial bots startup
Files can be read in parallel after all
This commit is contained in:
@@ -185,7 +185,7 @@ namespace ArchiSteamFarm {
|
||||
return IdlingPriorityAppIDs.Contains(appID);
|
||||
}
|
||||
|
||||
internal static BotDatabase Load(string filePath) {
|
||||
internal static async Task<BotDatabase> Load(string filePath) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(filePath));
|
||||
return null;
|
||||
@@ -198,7 +198,7 @@ namespace ArchiSteamFarm {
|
||||
BotDatabase botDatabase;
|
||||
|
||||
try {
|
||||
botDatabase = JsonConvert.DeserializeObject<BotDatabase>(File.ReadAllText(filePath));
|
||||
botDatabase = JsonConvert.DeserializeObject<BotDatabase>(await File.ReadAllTextAsync(filePath).ConfigureAwait(false));
|
||||
} catch (Exception e) {
|
||||
ASF.ArchiLogger.LogGenericException(e);
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user