aggiunta eliminazione da cache

This commit is contained in:
zaccaria.majid
2023-06-13 11:56:37 +02:00
parent 4db5acc56f
commit 52acadda42
5 changed files with 19 additions and 5 deletions
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.VisualBasic;
using NLog;
using StackExchange.Redis;
using WebDoorCreator.Data.DTO;
using WebDoorCreator.Data.Services;
@@ -96,7 +98,7 @@ namespace WebDoorCreator.API.Controllers
* da riscrivere
* - server record x cancellazione logica delle porte OK
* - il record (boolean, toDelete...) indica azione richiesta OK
* - si prendono TUTTE le porte da DB con toDelete == true ok
* - si prendono TUTTE le porte da DB con toDelete == true OK
* - si eliminano su REDIS dalle 4 code (req, processing, error, done)
* - check delle code processing, SE ci sono record rimasti li cerco sul DB
* - se NON ci sono sul db --> li elimino da processing
@@ -107,6 +109,18 @@ namespace WebDoorCreator.API.Controllers
var doors2Del = await WDService.DoorGet2Del();
if(doors2Del != null)
{
foreach(var item in doors2Del)
{
//RedisValue pattern = new RedisValue($"{Core.Constants.rKeyDoor}:{item.DoorId}");
await WDService.FlushCustomPattern($"Cache:Door:{item.DoorId}");
await WDService.FlushCustomPattern($"CalcRequest:CacheDDF:{item.DoorId}");
await WDService.FlushCustomPattern($"CalcRequest:CacheSVG:{item.DoorId}");
await WDService.FlushCustomPattern($"CalcRequest:Errors:{item.DoorId}");
}
}
bool fatto = await QDataServ.ResetQueueProcessing();