feat(api,core,domain): Ключи для редис
This commit is contained in:
@@ -9,6 +9,7 @@ using PARR.Core.Common.Interfaces;
|
||||
using PARR.Core.Repositories.Interfaces;
|
||||
using PARR.Core.Services.NextRunServices;
|
||||
using PARR.Core.Services.Workload.Implementations;
|
||||
using PARR.Domain.Cache;
|
||||
|
||||
namespace PARR.API.Controllers.V1
|
||||
{
|
||||
@@ -20,6 +21,7 @@ namespace PARR.API.Controllers.V1
|
||||
private readonly INextRunService nextRunService;
|
||||
private readonly ITemplateRepository templateService;
|
||||
private readonly WorkloadCacheService workloadCacheService;
|
||||
private readonly ILogger<TestController> logger;
|
||||
|
||||
public TestController(
|
||||
IClientService clientService,
|
||||
@@ -27,7 +29,8 @@ namespace PARR.API.Controllers.V1
|
||||
INextRunService nextRunService,
|
||||
ITemplateRepository templateService,
|
||||
MqSettings mqSettings,
|
||||
WorkloadCacheService workloadCacheService
|
||||
WorkloadCacheService workloadCacheService,
|
||||
ILogger<TestController> logger
|
||||
)
|
||||
{
|
||||
this.clientService = clientService;
|
||||
@@ -35,6 +38,7 @@ namespace PARR.API.Controllers.V1
|
||||
this.nextRunService = nextRunService;
|
||||
this.templateService = templateService;
|
||||
this.workloadCacheService = workloadCacheService;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,8 +82,25 @@ namespace PARR.API.Controllers.V1
|
||||
[HttpPost(ApiRoutes.Test.CreateCache)]
|
||||
public async Task<IActionResult> CreateCache()
|
||||
{
|
||||
#region Test bucket id
|
||||
|
||||
// var aaa = await workloadCacheService.GetTemplateReportDataAsync();
|
||||
var idList = new List<Guid>();
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
idList.Add( Guid.NewGuid());
|
||||
|
||||
foreach(var id in idList.OrderBy(t => t))
|
||||
{
|
||||
var key = CacheKeys.Unit.UnitHashWithBucket(id);
|
||||
var redisKey = redisCacheService.GetKey(key);
|
||||
|
||||
logger.LogDebug("Id: {Id}, key: '{Key}', redis key: '{RedisKey}'", id, key, redisKey);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
// var aaa = await workloadCacheService.GetTemplateReportDataAsync();
|
||||
|
||||
//var val = await redisCacheService.GetCachedDataAsync<object>("96dAoIH/8Q9Bg8VY");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user