feat(core, infrastructure): IRedisCacheService - данные теперь можно архивировать

This commit is contained in:
Mikhail Trubnikov
2026-05-07 12:27:57 +10:00
parent 277bf0caa3
commit 395ef6a0ea
4 changed files with 164 additions and 52 deletions

View File

@@ -1,6 +1,5 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using NodaTime;
using PARR.Core.Common.Interfaces;
using PARR.Core.Repositories.Interfaces;
using PARR.Core.Services.Shortcodes;
@@ -308,7 +307,7 @@ namespace PARR.Core.Services.Workload.Implementations
{
var key = GetReportCacheKey(reportType, dateStart, durationDays, offset, filterParam);
return await redisCacheService.GetCachedDataAsync<WorkloadReport>(key);
return await redisCacheService.GetCachedDataAsync<WorkloadReport>(key, true);
}
@@ -325,7 +324,7 @@ namespace PARR.Core.Services.Workload.Implementations
public async Task SetWorkloadReport(WorkloadReport report, WorkloadReportType reportType, DateOnly dateStart, int durationDays, TimeSpan offset, string? filterParam)
{
var key = GetReportCacheKey(reportType, dateStart, durationDays, offset, filterParam);
await redisCacheService.SetCachedDataAsync(key, report, cacheWorkloadTtl);
await redisCacheService.SetCachedDataAsync(key, report, cacheWorkloadTtl, true);
}
@@ -377,11 +376,5 @@ namespace PARR.Core.Services.Workload.Implementations
return keyStr;
}
}
}