cold storage retention should be days
limit is double though jksdfjklsdfkl
This commit is contained in:
@@ -20,7 +20,7 @@ public class StaticFilesServerConfiguration : MareConfigurationBase
|
||||
public bool UseColdStorage { get; set; } = false;
|
||||
public string? ColdStorageDirectory { get; set; } = null;
|
||||
public double ColdStorageSizeHardLimitInGiB { get; set; } = -1;
|
||||
public double ColdStorageUnusedFileRetentionPeriodInDays { get; set; } = 30;
|
||||
public int ColdStorageUnusedFileRetentionPeriodInDays { get; set; } = 30;
|
||||
[RemoteConfiguration]
|
||||
public Uri CdnFullUrl { get; set; } = null;
|
||||
[RemoteConfiguration]
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MainFileCleanupService : IHostedService
|
||||
var allFilesInColdStorageDir = dirColdStorage.GetFiles("*", SearchOption.AllDirectories).ToList();
|
||||
|
||||
var coldStorageRetention = _configuration.GetValueOrDefault(nameof(StaticFilesServerConfiguration.ColdStorageUnusedFileRetentionPeriodInDays), 60);
|
||||
var coldStorageSize = _configuration.GetValueOrDefault(nameof(StaticFilesServerConfiguration.ColdStorageSizeHardLimitInGiB), -1);
|
||||
var coldStorageSize = _configuration.GetValueOrDefault<double>(nameof(StaticFilesServerConfiguration.ColdStorageSizeHardLimitInGiB), -1);
|
||||
|
||||
// clean up cold storage
|
||||
var remainingColdFiles = await CleanUpOutdatedFiles(coldStorageDir, allFilesInColdStorageDir, coldStorageRetention, forcedDeletionAfterHours: -1,
|
||||
|
||||
Reference in New Issue
Block a user