mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 17:07:22 +01:00
add forced invoke scan for clearing cache dir, add forced rescan on pause
This commit is contained in:
parent
79b412b00a
commit
a02c872307
3 changed files with 11 additions and 4 deletions
|
|
@ -70,8 +70,9 @@ public class PeriodicFileScanner : IDisposable
|
|||
_scanCancellationTokenSource?.Cancel();
|
||||
}
|
||||
|
||||
public void InvokeScan()
|
||||
public void InvokeScan(bool forced = false)
|
||||
{
|
||||
bool isForced = forced;
|
||||
_scanCancellationTokenSource?.Cancel();
|
||||
_scanCancellationTokenSource = new CancellationTokenSource();
|
||||
var token = _scanCancellationTokenSource.Token;
|
||||
|
|
@ -80,8 +81,9 @@ public class PeriodicFileScanner : IDisposable
|
|||
while (!token.IsCancellationRequested)
|
||||
{
|
||||
RecalculateFileCacheSize();
|
||||
if (!_pluginConfiguration.FileScanPaused)
|
||||
if (!_pluginConfiguration.FileScanPaused || isForced)
|
||||
{
|
||||
isForced = false;
|
||||
await PeriodicFileScan(token);
|
||||
}
|
||||
_timeUntilNextScan = TimeSpan.FromSeconds(timeBetweenScans);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue