mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 20:07:21 +01:00
actually fixes for file scanner max size
This commit is contained in:
parent
69e8f3be83
commit
32d04bb8df
1 changed files with 2 additions and 2 deletions
|
|
@ -135,11 +135,11 @@ public class PeriodicFileScanner : MediatorSubscriberBase, IDisposable
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (FileCacheSize < (long)(_configService.Current.MaxLocalCacheInGiB * 1024 * 1024 * 1024)) return false;
|
if (FileCacheSize < (long)(_configService.Current.MaxLocalCacheInGiB * 1024d * 1024d * 1024d)) return false;
|
||||||
|
|
||||||
var allFiles = Directory.EnumerateFiles(_configService.Current.CacheFolder)
|
var allFiles = Directory.EnumerateFiles(_configService.Current.CacheFolder)
|
||||||
.Select(f => new FileInfo(f)).OrderBy(f => f.LastAccessTime).ToList();
|
.Select(f => new FileInfo(f)).OrderBy(f => f.LastAccessTime).ToList();
|
||||||
while (FileCacheSize > (long)(_configService.Current.MaxLocalCacheInGiB * 1024 * 1024 * 1024))
|
while (FileCacheSize > (long)(_configService.Current.MaxLocalCacheInGiB * 1024d * 1024d * 1024d))
|
||||||
{
|
{
|
||||||
var oldestFile = allFiles[0];
|
var oldestFile = allFiles[0];
|
||||||
FileCacheSize -= oldestFile.Length;
|
FileCacheSize -= oldestFile.Length;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue