mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 18:27:24 +01:00
add some locking around modifiedfiles
This commit is contained in:
parent
8d6b7346ec
commit
ce6764cbf8
2 changed files with 22 additions and 7 deletions
|
|
@ -123,9 +123,13 @@ namespace MareSynchronos.WebAPI
|
|||
{
|
||||
await using (var db = new FileCacheContext())
|
||||
{
|
||||
allFilesInDb = CurrentDownloads[currentDownloadId]
|
||||
var fileCount = CurrentDownloads[currentDownloadId]
|
||||
.Where(c => c.CanBeTransferred)
|
||||
.All(h => db.FileCaches.Any(f => f.Hash == h.Hash));
|
||||
.Count(h => db.FileCaches.Any(f => f.Hash == h.Hash));
|
||||
var totalFiles = CurrentDownloads[currentDownloadId].Count(c => c.CanBeTransferred);
|
||||
Logger.Debug("Waiting for files to be in the DB, added " + fileCount + " of " + totalFiles);
|
||||
|
||||
allFilesInDb = fileCount == totalFiles;
|
||||
}
|
||||
|
||||
await Task.Delay(250, ct);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue