fix some performance issues

This commit is contained in:
rootdarkarchon
2023-01-05 17:57:30 +01:00
parent 7e87dc61e7
commit 90a25c23dc
5 changed files with 25 additions and 9 deletions

View File

@@ -7,6 +7,7 @@ using System.Text.RegularExpressions;
using MareSynchronos.FileCache;
using MareSynchronos.Managers;
using MareSynchronos.Utils;
using System;
namespace MareSynchronos.Models;
@@ -40,8 +41,16 @@ public class FileReplacement
_ = Task.Run(() =>
{
var cache = fileDbManager.GetFileCacheByPath(ResolvedPath)!;
Hash = cache.Hash;
try
{
var cache = fileDbManager.GetFileCacheByPath(ResolvedPath)!;
Hash = cache.Hash;
}
catch (Exception ex)
{
Logger.Warn("Could not set Hash for " + ResolvedPath + ", resetting to original");
ResolvedPath = GamePaths.First();
}
});
}