rework for ui shit

This commit is contained in:
rootdarkarchon
2023-03-18 21:39:17 +01:00
parent d817eda5e2
commit f6a471f457
19 changed files with 821 additions and 681 deletions

View File

@@ -122,10 +122,13 @@ public sealed class FileCacheManager : IDisposable
return validatedCacheEntry;
}
public void RemoveHash(FileCacheEntity entity)
public void RemoveHash(FileCacheEntity? entity)
{
_logger.LogTrace("Removing {path}", entity.ResolvedFilepath);
_fileCaches.Remove(entity.PrefixedFilePath, out _);
if (entity != null)
{
_logger.LogTrace("Removing {path}", entity.ResolvedFilepath);
_fileCaches.Remove(entity.PrefixedFilePath, out _);
}
}
public string ResolveFileReplacement(string gamePath)

View File

@@ -15,7 +15,7 @@ public sealed class PeriodicFileScanner : DisposableMediatorSubscriberBase
private readonly PerformanceCollectorService _performanceCollector;
private long _currentFileProgress = 0;
private bool _fileScanWasRunning = false;
private CancellationTokenSource? _scanCancellationTokenSource;
private CancellationTokenSource _scanCancellationTokenSource = new();
private TimeSpan _timeUntilNextScan = TimeSpan.Zero;
public PeriodicFileScanner(ILogger<PeriodicFileScanner> logger, IpcManager ipcManager, MareConfigService configService,
@@ -246,7 +246,7 @@ public sealed class PeriodicFileScanner : DisposableMediatorSubscriberBase
Logger.LogWarning(ex, "Error during enumerating FileCaches");
}
Task.WaitAll(dbTasks);
Task.WaitAll(dbTasks, _scanCancellationTokenSource.Token);
if (!_ipcManager.CheckPenumbraApi())
{
@@ -308,7 +308,7 @@ public sealed class PeriodicFileScanner : DisposableMediatorSubscriberBase
if (ct.IsCancellationRequested) return;
}
Task.WaitAll(dbTasks);
Task.WaitAll(dbTasks, _scanCancellationTokenSource.Token);
Logger.LogTrace("Scanner added new files to db");