fix file cache size calculation exception, add more logging to character data factory, add more resilience into file system scan

This commit is contained in:
Stanley Dimant
2022-07-06 09:14:09 +02:00
parent 54abfd74dc
commit 145dc50f8a
4 changed files with 26 additions and 8 deletions

View File

@@ -40,7 +40,7 @@ namespace MareSynchronos.Models
FileCache? fileCache;
using (FileCacheContext db = new())
{
fileCache = db.FileCaches.SingleOrDefault(f => f.Filepath == path.ToLower());
fileCache = db.FileCaches.FirstOrDefault(f => f.Filepath == path.ToLower());
}
if (fileCache != null)
@@ -88,7 +88,7 @@ namespace MareSynchronos.Models
string hash = Crypto.GetFileHash(fi.FullName);
using FileCacheContext db = new();
var fileAddedDuringCompute = db.FileCaches.SingleOrDefault(f => f.Filepath == fi.FullName.ToLower());
var fileAddedDuringCompute = db.FileCaches.FirstOrDefault(f => f.Filepath == fi.FullName.ToLower());
if (fileAddedDuringCompute != null) return fileAddedDuringCompute.Hash;
try