Continuo code cleanup metodi STATS
This commit is contained in:
@@ -49,6 +49,7 @@ namespace MP.Core
|
||||
public const string redisOdlLastByMac = redisXdlData + "LastOdlByMac";
|
||||
|
||||
public const string redisOdlList = redisXdlData + "OdlList";
|
||||
public const string redisOdlStats = redisXdlData + "OdlStats";
|
||||
|
||||
public const string redisOprList = redisBaseAddr + "Cache:OprList";
|
||||
|
||||
|
||||
@@ -54,63 +54,57 @@ namespace MP.Data.Controllers
|
||||
/// Stacca un nuovo counter x il tipo richiesto
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public AnagCountersModel AnagCountersGetNext(string cntType)
|
||||
public async Task<AnagCountersModel> AnagCountersGetNextAsync(string cntType)
|
||||
{
|
||||
AnagCountersModel answ = new AnagCountersModel();
|
||||
using var dbCtx = new MoonProContext(options);
|
||||
bool outTable = true;
|
||||
if (outTable)
|
||||
{
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
var pCntType = new SqlParameter("@CntType", cntType);
|
||||
var pLastNum = new SqlParameter
|
||||
{
|
||||
var pCntType = new SqlParameter("@CntType", cntType);
|
||||
var pLastNum = new SqlParameter
|
||||
{
|
||||
ParameterName = "@LastNum",
|
||||
SqlDbType = SqlDbType.Int,
|
||||
Direction = ParameterDirection.Output
|
||||
};
|
||||
ParameterName = "@LastNum",
|
||||
SqlDbType = SqlDbType.Int,
|
||||
Direction = ParameterDirection.Output
|
||||
};
|
||||
|
||||
var dbResult = dbCtx
|
||||
var dbResult = await dbCtx
|
||||
.DbSetAnagCount
|
||||
.FromSqlRaw("EXEC dbo.stp_getNextNumb @CntType, @LastNum OUTPUT", pCntType, pLastNum)
|
||||
.AsNoTracking()
|
||||
.AsEnumerable()
|
||||
.FirstOrDefault();
|
||||
if (dbResult != null)
|
||||
{
|
||||
answ = dbResult;
|
||||
}
|
||||
.FirstOrDefaultAsync();
|
||||
if (dbResult != null)
|
||||
{
|
||||
answ = dbResult;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// se si volessero impiegare parametri OUTPUT (qui ne mancherebbe 1 nella stored x CntCode...)
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
var pCntType = new SqlParameter("@CntType", cntType);
|
||||
var pLastNum = new SqlParameter
|
||||
{
|
||||
var pCntType = new SqlParameter("@CntType", cntType);
|
||||
var pLastNum = new SqlParameter
|
||||
{
|
||||
ParameterName = "@LastNum",
|
||||
SqlDbType = SqlDbType.Int,
|
||||
Direction = ParameterDirection.Output
|
||||
};
|
||||
var pCntCode = new SqlParameter
|
||||
{
|
||||
ParameterName = "@CntCode",
|
||||
SqlDbType = SqlDbType.NVarChar,
|
||||
Direction = ParameterDirection.Output
|
||||
};
|
||||
var dbResult = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC dbo.stp_getNextNumb @CntType, @LastNum OUTPUT, @CntCode OUTPUT", pCntType, pLastNum, pCntCode);
|
||||
if (dbResult != 0)
|
||||
{
|
||||
answ.CntType = cntType;
|
||||
answ.CntCode = $"{pCntCode.Value}";
|
||||
int lNum = 0;
|
||||
int.TryParse($"{pLastNum.Value}", out lNum);
|
||||
answ.LastNum = lNum;
|
||||
}
|
||||
ParameterName = "@LastNum",
|
||||
SqlDbType = SqlDbType.Int,
|
||||
Direction = ParameterDirection.Output
|
||||
};
|
||||
var pCntCode = new SqlParameter
|
||||
{
|
||||
ParameterName = "@CntCode",
|
||||
SqlDbType = SqlDbType.NVarChar,
|
||||
Direction = ParameterDirection.Output
|
||||
};
|
||||
var dbResult = await dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRawAsync("EXEC dbo.stp_getNextNumb @CntType, @LastNum OUTPUT, @CntCode OUTPUT", pCntType, pLastNum, pCntCode);
|
||||
if (dbResult != 0)
|
||||
{
|
||||
answ.CntType = cntType;
|
||||
answ.CntCode = $"{pCntCode.Value}";
|
||||
int lNum = 0;
|
||||
int.TryParse($"{pLastNum.Value}", out lNum);
|
||||
answ.LastNum = lNum;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
@@ -782,25 +776,13 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="editRec">record dossier da modificare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersInsert(DossierModel newRec)
|
||||
public async Task<bool> DossiersInsertAsync(DossierModel newRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonPro_FluxContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
dbCtx
|
||||
.DbSetDossiers
|
||||
.Add(newRec);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante DossiersInsert{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
using var dbCtx = new MoonPro_FluxContext(_configuration);
|
||||
dbCtx
|
||||
.DbSetDossiers
|
||||
.AddAsync(newRec);
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -832,21 +814,17 @@ namespace MP.Data.Controllers
|
||||
/// <param name="idxMacchina">macchina</param>
|
||||
/// <param name="dtMin">Data min x selezione</param>
|
||||
/// <param name="dtMax">Data MAX x selezione</param>
|
||||
public bool DossiersTakeParamsSnapshotLast(string idxMacchina, DateTime dtMin, DateTime dtMax)
|
||||
public async Task<bool> DossiersTakeParamsSnapshotLastAsync(string idxMacchina, DateTime dtMin, DateTime dtMax)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonPro_FluxContext(_configuration))
|
||||
{
|
||||
var pIdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var pDtMin = new SqlParameter("@DtMin", dtMin);
|
||||
var pDtMax = new SqlParameter("@DtMax", dtMax);
|
||||
using var dbCtx = new MoonPro_FluxContext(_configuration);
|
||||
var pIdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var pDtMin = new SqlParameter("@DtMin", dtMin);
|
||||
var pDtMax = new SqlParameter("@DtMax", dtMax);
|
||||
|
||||
var dbResult = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC stp_FL_TakeSnapshotLast @IdxMacchina,@DtMin,@DtMax", pIdxMacchina, pDtMin, pDtMax);
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
var dbResult = await dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRawAsync("EXEC stp_FL_TakeSnapshotLast @IdxMacchina,@DtMin,@DtMax", pIdxMacchina, pDtMin, pDtMax);
|
||||
return dbResult != 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -854,37 +832,25 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="editRec">record dossier da modificare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersUpdateValore(DossierModel editRec)
|
||||
public async Task<bool> DossiersUpdateValoreAsync(DossierModel editRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonPro_FluxContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetDossiers
|
||||
.Where(x => x.IdxDossier == editRec.IdxDossier)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec.Valore = editRec.Valore;
|
||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
dbCtx
|
||||
using var dbCtx = new MoonPro_FluxContext(_configuration);
|
||||
var currRec = await dbCtx
|
||||
.DbSetDossiers
|
||||
.Add(editRec);
|
||||
}
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante DossiersUpdateRecord{Environment.NewLine}{exc}");
|
||||
}
|
||||
.Where(x => x.IdxDossier == editRec.IdxDossier)
|
||||
.FirstOrDefaultAsync();
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec.Valore = editRec.Valore;
|
||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
return fatto;
|
||||
else
|
||||
{
|
||||
await dbCtx
|
||||
.DbSetDossiers
|
||||
.AddAsync(editRec);
|
||||
}
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -920,25 +886,14 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="newRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> EvListInsert(EventListModel newRec)
|
||||
public async Task<bool> EvListInsertAsync(EventListModel newRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetEvList
|
||||
.Add(newRec);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante EvListInsert{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
await Task.Delay(1);
|
||||
return fatto;
|
||||
using var dbCtx = new MoonProContext(options);
|
||||
var currRec = await dbCtx
|
||||
.DbSetEvList
|
||||
.AddAsync(newRec);
|
||||
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -952,10 +907,10 @@ namespace MP.Data.Controllers
|
||||
/// <returns>
|
||||
/// Restitusice list dei record statistiche raccolti (da integrare a quelli rpesenti in Redis...)
|
||||
/// </returns>
|
||||
public async Task<List<StatDedupDTO>> FluxLogDataRedux(string idxMaccSel, List<string> fluxList, Periodo currPeriodo, Enums.ValSelection valMode, Enums.DataInterval intReq, int maxItem)
|
||||
public async Task<List<StatDedupDTO>> FluxLogDataReduxAsync(string idxMaccSel, List<string> fluxList, Periodo currPeriodo, Enums.ValSelection valMode, Enums.DataInterval intReq, int maxItem)
|
||||
{
|
||||
List<StatDedupDTO> procStats = new List<StatDedupDTO>();
|
||||
Log.Info($"Inizio FluxLogDataRedux | idxMaccSel: {idxMaccSel} | periodo: {currPeriodo.Inizio:yyyy-MM-dd} --> {currPeriodo.Fine:yyyy-MM-dd}");
|
||||
Log.Info($"Inizio FluxLogDataReduxAsync | idxMaccSel: {idxMaccSel} | periodo: {currPeriodo.Inizio:yyyy-MM-dd} --> {currPeriodo.Fine:yyyy-MM-dd}");
|
||||
TimeSpan step = TimeSpan.FromHours(1);
|
||||
switch (intReq)
|
||||
{
|
||||
@@ -982,7 +937,7 @@ namespace MP.Data.Controllers
|
||||
// processo 1:1 ogni flusso
|
||||
foreach (var item in fluxList)
|
||||
{
|
||||
Log.Info($"FluxLogDataRedux | Flux: {item}");
|
||||
Log.Info($"FluxLogDataReduxAsync | Flux: {item}");
|
||||
int numRecProc = 0;
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
@@ -1058,9 +1013,9 @@ namespace MP.Data.Controllers
|
||||
// parametri x periodo (base)
|
||||
var pDtStart = new SqlParameter("@DtStart", slot.Inizio);
|
||||
var pDtEnd = new SqlParameter("@DtEnd", slot.Fine);
|
||||
var dbResult = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC man.stp_ReduceFluxLog @IdxMacchina, @CodFlux, @DtStart, @DtEnd, @OnlyTest", pIdxMacchina, pCodFlux, pDtStart, pDtEnd, pOnlyTest);
|
||||
var dbResult = await dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRawAsync("EXEC man.stp_ReduceFluxLog @IdxMacchina, @CodFlux, @DtStart, @DtEnd, @OnlyTest", pIdxMacchina, pCodFlux, pDtStart, pDtEnd, pOnlyTest);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1083,7 +1038,7 @@ namespace MP.Data.Controllers
|
||||
};
|
||||
procStats.Add(currStat);
|
||||
}
|
||||
Log.Info($"FINE FluxLogDataRedux | idxMaccSel: {idxMaccSel} | periodo: {currPeriodo.Inizio:yyyy-MM-dd} --> {currPeriodo.Fine:yyyy-MM-dd}");
|
||||
Log.Info($"FINE FluxLogDataReduxAsync | idxMaccSel: {idxMaccSel} | periodo: {currPeriodo.Inizio:yyyy-MM-dd} --> {currPeriodo.Fine:yyyy-MM-dd}");
|
||||
return procStats;
|
||||
}
|
||||
|
||||
@@ -1914,73 +1869,63 @@ namespace MP.Data.Controllers
|
||||
/// <param name="confRett">Conferma con rettifica (ev 121) x pezzi lasciati in macchina</param>
|
||||
/// <param name="modoConfProd">Modo conferma produzione (0=periodo, 1=giorno, 2=turno)</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ODLClose(int idxOdl, string idxMacchina, int matrOpr, bool confPezzi, bool confRett, int modoConfProd)
|
||||
public async Task<bool> ODLCloseAsync(int idxOdl, string idxMacchina, int matrOpr, bool confPezzi, bool confRett, int modoConfProd)
|
||||
{
|
||||
bool fatto = false;
|
||||
await Task.Delay(1);
|
||||
if (idxOdl > 0)
|
||||
{
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
using var dbCtx = new MoonProContext(options);
|
||||
DateTime adesso = DateTime.Now;
|
||||
// preparo i parametri
|
||||
var IdxODL = new SqlParameter("@IdxODL", idxOdl);
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
|
||||
|
||||
// se richiesto confermo produzione
|
||||
if (confPezzi)
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
// preparo i parametri
|
||||
var IdxODL = new SqlParameter("@IdxODL", idxOdl);
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var MatrApp = new SqlParameter("@MatrApp", idxMacchina);
|
||||
|
||||
// FARE FIXME TODO !!! da valutare casi setup/autoconferma...
|
||||
#if false
|
||||
// controllo se HO pezzi da confermare...
|
||||
var statoProd = StatoProdMacchina(idxMacchina);
|
||||
if (statoProd.pezziNonConfermati < 1)
|
||||
{ }
|
||||
#endif
|
||||
/* ----------------------------------
|
||||
* CONFERMA PEZZI
|
||||
*
|
||||
* condizioni da verificare:
|
||||
* - gestione rettifica (ev121) / pezzi da LASCIARE in macchina
|
||||
* - conferma a zero pezzi (setup) oppure con i pezzi fatti e non ancora confermati
|
||||
*
|
||||
*
|
||||
*
|
||||
* */
|
||||
|
||||
// se richiesto confermo produzione
|
||||
if (confPezzi)
|
||||
{
|
||||
var MatrApp = new SqlParameter("@MatrApp", idxMacchina);
|
||||
// recupero i dati dei pezzi da confermare... con DbSetPzProd + exec
|
||||
// stp_PzProd_getByMacchina 'SIMUL_01'
|
||||
|
||||
/* ----------------------------------
|
||||
* CONFERMA PEZZI
|
||||
*
|
||||
* condizioni da verificare:
|
||||
* - gestione rettifica (ev121) / pezzi da LASCIARE in macchina
|
||||
* - conferma a zero pezzi (setup) oppure con i pezzi fatti e non ancora confermati
|
||||
*
|
||||
*
|
||||
*
|
||||
* */
|
||||
// stp_ConfermaProduzCompletaFull
|
||||
/*
|
||||
* @idxMacchina NVARCHAR(50),
|
||||
@MatrApp INT,
|
||||
@dataFrom DATETIME,
|
||||
@dataTo DATETIME,
|
||||
@pezziConf INT,
|
||||
@pezziLasciati INT, -- pezzi lasciati = evento 121 (-) pre conferma e (+) dopo --> da lasciare in macchina post conferma
|
||||
@pezziScar INT = 0, -- pezzi scartati (registrati da 2016.11.20) DA INDICARE COME VALORE > 0!!! sennò faccio ABS...
|
||||
@TipoConf INT = 0, -- Tipo intervallo conferma: 0 = periodo intero, 1 = per giorni, 2 = per turni
|
||||
@DataOraApp DATETIME = NULL, -- di norma GETDATE() nel programma - serve per ricalcolo
|
||||
@TestConferma BIT = 1 -- TestConferma : 1 = verifica conf. duplicata e inserisci in ElencoConfermeProd, 0 = nessuna verifica e inserimento ( per ricalcolo )
|
||||
*/
|
||||
}
|
||||
|
||||
// recupero i dati dei pezzi da confermare... con DbSetPzProd + exec
|
||||
// stp_PzProd_getByMacchina 'SIMUL_01'
|
||||
|
||||
// stp_ConfermaProduzCompletaFull
|
||||
/*
|
||||
* @idxMacchina NVARCHAR(50),
|
||||
@MatrApp INT,
|
||||
@dataFrom DATETIME,
|
||||
@dataTo DATETIME,
|
||||
@pezziConf INT,
|
||||
@pezziLasciati INT, -- pezzi lasciati = evento 121 (-) pre conferma e (+) dopo --> da lasciare in macchina post conferma
|
||||
@pezziScar INT = 0, -- pezzi scartati (registrati da 2016.11.20) DA INDICARE COME VALORE > 0!!! sennò faccio ABS...
|
||||
@TipoConf INT = 0, -- Tipo intervallo conferma: 0 = periodo intero, 1 = per giorni, 2 = per turni
|
||||
@DataOraApp DATETIME = NULL, -- di norma GETDATE() nel programma - serve per ricalcolo
|
||||
@TestConferma BIT = 1 -- TestConferma : 1 = verifica conf. duplicata e inserisci in ElencoConfermeProd, 0 = nessuna verifica e inserimento ( per ricalcolo )
|
||||
*/
|
||||
}
|
||||
|
||||
// ora chiudo ODL con stored SENZA ritorno...
|
||||
try
|
||||
{
|
||||
var dbResult = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC stp_ODL_fineProd @IdxODL, @IdxMacchina", IdxODL, IdxMacchina);
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante ODLClose{Environment.NewLine}{exc}");
|
||||
}
|
||||
// ora chiudo ODL con stored SENZA ritorno...
|
||||
try
|
||||
{
|
||||
var dbResult = await dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRawAsync("EXEC stp_ODL_fineProd @IdxODL, @IdxMacchina", IdxODL, IdxMacchina);
|
||||
fatto = dbResult != 0;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante ODLCloseAsync{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
@@ -2003,6 +1948,7 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Elenco TUTTI GLI ODL
|
||||
/// </summary>
|
||||
@@ -2025,27 +1971,26 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Statistiche ODL calcolate (da stored stp_STAT_ODL)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<StatODLModel>> OdlStart(int IdxOdl)
|
||||
public async Task<List<StatODLModel>> OdlGetStatAsync(int IdxOdl)
|
||||
{
|
||||
List<StatODLModel> dbResult = new List<StatODLModel>();
|
||||
if (IdxOdl > 0)
|
||||
{
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
{
|
||||
var IdxODL = new SqlParameter("@IdxODL", IdxOdl);
|
||||
using var dbCtx = new MoonProContext(options);
|
||||
var IdxODL = new SqlParameter("@IdxODL", IdxOdl);
|
||||
|
||||
dbResult = await dbCtx
|
||||
.DbSetStatOdl
|
||||
.FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL)
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
}
|
||||
dbResult = await dbCtx
|
||||
.DbSetStatOdl
|
||||
.FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL)
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
@@ -2128,27 +2073,15 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="idxPODL"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PODLModel> PODL_getByKey(int idxPODL)
|
||||
public async Task<PODLModel> PODL_getByKeyAsync(int idxPODL)
|
||||
{
|
||||
PODLModel dbResult = new PODLModel();
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
{
|
||||
try
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetPODL
|
||||
.AsNoTracking()
|
||||
.Where(x => x.IdxPromessa == idxPODL)
|
||||
.Include(a => a.ArticoloNav)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante PODL_getByKey{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
using var dbCtx = new MoonProContext(options);
|
||||
return await dbCtx
|
||||
.DbSetPODL
|
||||
.AsNoTracking()
|
||||
.Where(x => x.IdxPromessa == idxPODL)
|
||||
.Include(a => a.ArticoloNav)
|
||||
.FirstOrDefaultAsync() ?? new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2355,45 +2288,34 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODLUpdateRecord(PODLModel editRec)
|
||||
public async Task<bool> PODLUpdateRecordAsync(PODLModel editRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetPODL
|
||||
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec.CodGruppo = editRec.CodGruppo;
|
||||
currRec.CodArticolo = editRec.CodArticolo;
|
||||
currRec.IdxMacchina = editRec.IdxMacchina;
|
||||
currRec.KeyBCode = editRec.KeyBCode;
|
||||
currRec.KeyRichiesta = editRec.KeyRichiesta;
|
||||
currRec.NumPezzi = editRec.NumPezzi;
|
||||
currRec.Tcassegnato = editRec.Tcassegnato;
|
||||
currRec.Attivabile = editRec.Attivabile;
|
||||
currRec.Note = editRec.Note;
|
||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
dbCtx
|
||||
using var dbCtx = new MoonProContext(options);
|
||||
var currRec = await dbCtx
|
||||
.DbSetPODL
|
||||
.Add(editRec);
|
||||
}
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante PODLUpdateRecord{Environment.NewLine}{exc}");
|
||||
}
|
||||
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
|
||||
.FirstOrDefaultAsync();
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec.CodGruppo = editRec.CodGruppo;
|
||||
currRec.CodArticolo = editRec.CodArticolo;
|
||||
currRec.IdxMacchina = editRec.IdxMacchina;
|
||||
currRec.KeyBCode = editRec.KeyBCode;
|
||||
currRec.KeyRichiesta = editRec.KeyRichiesta;
|
||||
currRec.NumPezzi = editRec.NumPezzi;
|
||||
currRec.Tcassegnato = editRec.Tcassegnato;
|
||||
currRec.Attivabile = editRec.Attivabile;
|
||||
currRec.Note = editRec.Note;
|
||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
return fatto;
|
||||
else
|
||||
{
|
||||
await dbCtx
|
||||
.DbSetPODL
|
||||
.AddAsync(editRec);
|
||||
}
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2440,26 +2362,21 @@ namespace MP.Data.Controllers
|
||||
/// Elimina record
|
||||
/// </summary>
|
||||
/// <param name="rec2del"></param>
|
||||
public bool TemplateKitDelete(TemplateKitModel rec2del)
|
||||
public async Task<bool> TemplateKitDeleteAsync(TemplateKitModel rec2del)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(options))
|
||||
using var dbCtx = new MoonProContext(options);
|
||||
var actRec = await dbCtx
|
||||
.DbSetTempKit
|
||||
.Where(x => x.CodArtParent == rec2del.CodArtParent && x.CodArtChild == rec2del.CodArtChild)
|
||||
.FirstOrDefaultAsync();
|
||||
// se ci fosse aggiorno...
|
||||
if (actRec != null)
|
||||
{
|
||||
var actRec = dbCtx
|
||||
.DbSetTempKit
|
||||
.Where(x => x.CodArtParent == rec2del.CodArtParent && x.CodArtChild == rec2del.CodArtChild)
|
||||
.FirstOrDefault();
|
||||
// se ci fosse aggiorno...
|
||||
if (actRec != null)
|
||||
{
|
||||
dbCtx
|
||||
.DbSetTempKit
|
||||
.Remove(actRec);
|
||||
}
|
||||
var res = dbCtx.SaveChanges();
|
||||
fatto = res != 0;
|
||||
dbCtx
|
||||
.DbSetTempKit
|
||||
.Remove(actRec);
|
||||
}
|
||||
return fatto;
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -688,7 +688,7 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante EvListInsert{Environment.NewLine}{exc}");
|
||||
Log.Error($"Eccezione durante EvListInsertAsync{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
await Task.Delay(1);
|
||||
@@ -1709,7 +1709,7 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante PODL_getByKey{Environment.NewLine}{exc}");
|
||||
Log.Error($"Eccezione durante PODL_getByKeyAsync{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
|
||||
@@ -2412,7 +2412,7 @@ namespace MP.Data.Services
|
||||
#if false
|
||||
Log.Debug($"PODL_getByKey | {idxPODL} | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
#endif
|
||||
string callName = $"PODL_getByKey.{source}";
|
||||
string callName = $"PODL_getByKeyAsync.{source}";
|
||||
int numRec = esCollect.RecordCall(callName, sw.Elapsed.TotalMilliseconds);
|
||||
if (numRec >= nRecLog)
|
||||
{
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace MP.SPEC.Components
|
||||
if (currOdl != null && currOdl.IdxOdl == idxOdl)
|
||||
{
|
||||
// effettua chiusura sul DB
|
||||
fatto = await MDService.ODLClose(idxOdl, currOdl.IdxMacchina, 0, true);
|
||||
fatto = await MDService.ODLCloseAsync(idxOdl, currOdl.IdxMacchina, 0, true);
|
||||
if (fatto)
|
||||
{
|
||||
Log.Info($"Effettuata chiusura ODL {idxOdl}");
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace MP.SPEC.Components
|
||||
await Task.Delay(1);
|
||||
if (currRecord != null)
|
||||
{
|
||||
listaFlux = MDService.FluxLogDtoGetByFlux(currRecord.Valore);
|
||||
listaFlux = MDService.FluxLogDtoConvert(currRecord.Valore);
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
@@ -254,7 +254,7 @@ namespace MP.SPEC.Components
|
||||
{
|
||||
currRecord = selRec;
|
||||
await RecordSel.InvokeAsync(selRec);
|
||||
listaFlux = MDService.FluxLogDtoGetByFlux(selRec.Valore);
|
||||
listaFlux = MDService.FluxLogDtoConvert(selRec.Valore);
|
||||
await toggleTableFlux();
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace MP.SPEC.Components
|
||||
string newVal = JsonConvert.SerializeObject(updatedResult);
|
||||
currRecord.Valore = newVal;
|
||||
// METODO PER UPDATE FLUX
|
||||
await MDService.DossiersUpdateValore(currRecord);
|
||||
await MDService.DossiersUpdateValoreAsync(currRecord);
|
||||
currFluxLogDto = null;
|
||||
isEditing = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace MP.SPEC.Components
|
||||
if (currRecord != null)
|
||||
{
|
||||
// effettua chiusura sul DB
|
||||
await MDService.ODLClose(currRecord.IdxOdl, currRecord.IdxMacchina, 0, true);
|
||||
await MDService.ODLCloseAsync(currRecord.IdxOdl, currRecord.IdxMacchina, 0, true);
|
||||
Log.Info($"Effettuata chiusura ODL {currRecord.IdxOdl}");
|
||||
|
||||
// RESETTO task x setComm, setArt, SetPzComm
|
||||
@@ -426,7 +426,7 @@ namespace MP.SPEC.Components
|
||||
showStats = true;
|
||||
if (currRec != null)
|
||||
{
|
||||
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
|
||||
ListOdlStats = await MDService.OdlStatsAsync(currRec.IdxOdl);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace MP.SPEC.Components
|
||||
Data.Clear();
|
||||
Labels.Clear();
|
||||
colors.Clear();
|
||||
ListRecords = await MDService.StatOdl(SelectedOdl);
|
||||
ListRecords = await MDService.OdlStatsAsync(SelectedOdl);
|
||||
// se hideSpenta --> filtro stato 11 = spenta...
|
||||
if (hideSpenta)
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace MP.SPEC.Components
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione riga Istanza KIT: sei sicuro di voler procedere?"))
|
||||
return;
|
||||
|
||||
var done = await MDService.IstKitDelete(selRec);
|
||||
var done = await MDService.IstKitDeleteAsync(selRec);
|
||||
EditRecord = null;
|
||||
await ResetDataAsync();
|
||||
}
|
||||
@@ -119,7 +119,7 @@ namespace MP.SPEC.Components
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare le modifiche?"))
|
||||
return;
|
||||
|
||||
var done = await MDService.IstKitUpsert(selRec);
|
||||
var done = await MDService.IstKitUpsertAsync(selRec);
|
||||
EditRecord = null;
|
||||
await ResetDataAsync();
|
||||
}
|
||||
|
||||
+265
-278
@@ -124,7 +124,7 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"ActionGetReq Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"ActionGetReq | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -152,15 +152,15 @@ namespace MP.SPEC.Data
|
||||
/// Stacca un nuovo counter x il tipo richiesto
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public AnagCountersModel AnagCountersGetNext(string cntType)
|
||||
public async Task<AnagCountersModel> AnagCountersGetNextAsync(string cntType)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("AnagCountersGetNext");
|
||||
using var activity = ActivitySource.StartActivity("AnagCountersGetNextAsync");
|
||||
AnagCountersModel result = new AnagCountersModel();
|
||||
string source = "DB";
|
||||
result = dbController.AnagCountersGetNext(cntType);
|
||||
result = await dbController.AnagCountersGetNextAsync(cntType);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"AnagCountersGetNext | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"AnagCountersGetNextAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -190,12 +190,13 @@ namespace MP.SPEC.Data
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("AnagGruppiDeleteAsync");
|
||||
bool result = false;
|
||||
string source = "DB";
|
||||
result = dbController.AnagGruppiDelete(updRec);
|
||||
// elimino cache redis...
|
||||
await FlushCacheByTagAsync(Utils.redisAnagGruppi);
|
||||
activity?.SetTag("data.source", "DB");
|
||||
await FlushCacheAsync(Utils.redisAnagGruppi);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"AnagGruppiDeleteAsync | CodGruppo {updRec.CodGruppo} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"AnagGruppiDeleteAsync | CodGruppo {updRec.CodGruppo} | {source}{activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -208,12 +209,13 @@ namespace MP.SPEC.Data
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("AnagGruppiUpsertAsync");
|
||||
bool result = false;
|
||||
string source = "DB";
|
||||
result = dbController.AnagGruppiUpsert(UpdRec);
|
||||
// elimino cache redis...
|
||||
await FlushCacheByTagAsync(Utils.redisAnagGruppi);
|
||||
activity?.SetTag("data.source", "DB");
|
||||
await FlushCacheAsync(Utils.redisAnagGruppi);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"AnagGruppiUpsertAsync | CodGruppo {UpdRec.CodGruppo} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"AnagGruppiUpsertAsync | CodGruppo {UpdRec.CodGruppo} | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -294,12 +296,12 @@ namespace MP.SPEC.Data
|
||||
public async Task<bool> ArticoliDeleteRecord(AnagArticoliModel currRec)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("ArticoliDeleteRecord");
|
||||
string source = "DB+REDIS";
|
||||
string source = "DB";
|
||||
bool fatto = await dbController.ArticoliDeleteRecord(currRec);
|
||||
await resetCacheArticoli();
|
||||
await FlushCacheArticoli();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"ArticoliDeleteRecord | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"ArticoliDeleteRecord | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return fatto;
|
||||
}
|
||||
|
||||
@@ -370,12 +372,12 @@ namespace MP.SPEC.Data
|
||||
public async Task<bool> ArticoliUpdateRecord(AnagArticoliModel currRec)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("ArticoliUpdateRecord");
|
||||
string source = "DB+REDIS";
|
||||
string source = "DB";
|
||||
bool fatto = await dbController.ArticoliUpdateRecord(currRec);
|
||||
await resetCacheArticoli();
|
||||
await FlushCacheArticoli();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"ArticoliUpdateRecord | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"ArticoliUpdateRecord | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return fatto;
|
||||
}
|
||||
|
||||
@@ -462,10 +464,10 @@ namespace MP.SPEC.Data
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("ConfigResetCacheAsync");
|
||||
string source = "REDIS";
|
||||
await ResetConfigCache();
|
||||
await FlushCacheConfig();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"ConfigResetCacheAsync Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"ConfigResetCacheAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -500,7 +502,7 @@ namespace MP.SPEC.Data
|
||||
using var activity = ActivitySource.StartActivity("ConfigUpdateAsync");
|
||||
string source = "DB";
|
||||
var updRes = await dbController.ConfigUpdateAsync(updRec);
|
||||
await ResetConfigCache();
|
||||
await FlushCacheConfig();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"ConfigUpdateAsync Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -511,9 +513,9 @@ namespace MP.SPEC.Data
|
||||
/// Restituisce le statistiche di DB maintenance eseguite
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Dictionary<DateTime, double> DbDedupStats()
|
||||
public async Task<Dictionary<DateTime, double>> DbDedupStatsAsync()
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("DbDedupStats");
|
||||
using var activity = ActivitySource.StartActivity("DbDedupStatsAsync");
|
||||
string source = "REDIS";
|
||||
Dictionary<DateTime, double> actStats = new Dictionary<DateTime, double>();
|
||||
string currKey = $"{Utils.redisStatsDbMaint}";
|
||||
@@ -529,7 +531,7 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"DbDedupStats Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"DbDedupStatsAsync Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
return actStats;
|
||||
}
|
||||
|
||||
@@ -553,10 +555,8 @@ namespace MP.SPEC.Data
|
||||
using var activity = ActivitySource.StartActivity("DossiersDeleteRecordAsync");
|
||||
bool result = false;
|
||||
result = await dbController.DossiersDeleteRecordAsync(selRecord);
|
||||
// elimino cache redis...
|
||||
//RedisValue pattern = new RedisValue($"{Utils.redisDossByMac}:*");
|
||||
//bool answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
await FlushCacheByTagAsync(Utils.redisDossByMac);
|
||||
// elimino cache...
|
||||
await FlushCacheAsync(Utils.redisDossByMac);
|
||||
activity?.SetTag("data.source", "DB");
|
||||
activity?.Stop();
|
||||
LogTrace($"DossiersDeleteRecordAsync | IdxMacchina {selRecord.IdxMacchina} | DtRif {selRecord.DtRif} | IdxODL {selRecord.IdxODL} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -591,13 +591,14 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersInsert(DossierModel currDoss)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("DossiersInsert");
|
||||
using var activity = ActivitySource.StartActivity("DossiersInsertAsync");
|
||||
string source = "DB";
|
||||
// aggiorno record sul DB
|
||||
bool answ = await dbController.DossiersInsert(currDoss);
|
||||
bool answ = await dbController.DossiersInsertAsync(currDoss);
|
||||
answ = await FlushCacheAsync(Utils.redisDossByMac);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"DossiersInsert | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"DossiersInsertAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -610,18 +611,17 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersTakeParamsSnapshotLast(string IdxMacchina, DateTime dtMin, DateTime dtMax)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("DossiersUpdateValore");
|
||||
string source = "DB+REDIS";
|
||||
using var activity = ActivitySource.StartActivity("DossiersUpdateValoreAsync");
|
||||
string source = "DB";
|
||||
bool answ = false;
|
||||
Log.Info($"Richiesta snapshot per idxMaccSel {IdxMacchina} | periodo {dtMin} --> {dtMax}");
|
||||
// chiamo stored x salvare parametri
|
||||
dbController.DossiersTakeParamsSnapshotLast(IdxMacchina, dtMin, dtMax);
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{Utils.redisDossByMac}:*");
|
||||
answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
activity?.SetTag("data.source", "DB+REDIS");
|
||||
await dbController.DossiersTakeParamsSnapshotLastAsync(IdxMacchina, dtMin, dtMax);
|
||||
// elimino cache...
|
||||
answ = await FlushCacheAsync(Utils.redisDossByMac);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"DossiersTakeParamsSnapshotLast | Svuotata cache dossier | {pattern} | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"DossiersTakeParamsSnapshotLastAsync | Svuotata cache dossier | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -630,15 +630,16 @@ namespace MP.SPEC.Data
|
||||
/// </summary>
|
||||
/// <param name="currDoss"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersUpdateValore(DossierModel currDoss)
|
||||
public async Task<bool> DossiersUpdateValoreAsync(DossierModel currDoss)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("DossiersUpdateValore");
|
||||
using var activity = ActivitySource.StartActivity("DossiersUpdateValoreAsync");
|
||||
string source = "DB";
|
||||
// aggiorno record sul DB
|
||||
bool answ = await dbController.DossiersUpdateValore(currDoss);
|
||||
bool answ = await dbController.DossiersUpdateValoreAsync(currDoss);
|
||||
answ = await FlushCacheAsync(Utils.redisDossByMac);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"DossiersUpdateValore | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"DossiersUpdateValoreAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -749,64 +750,15 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public async Task<bool> EvListInsert(EventListModel newRec)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("EvListInsert");
|
||||
using var activity = ActivitySource.StartActivity("EvListInsertAsync");
|
||||
string source = "DB";
|
||||
var result = await dbController.EvListInsert(newRec);
|
||||
var result = await dbController.EvListInsertAsync(newRec);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"EvListInsert | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"EvListInsertAsync | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue flush memoria redis dato keyVal
|
||||
/// </summary>
|
||||
/// <param name="pat2Flush"></param>
|
||||
/// <returns></returns>
|
||||
public bool ExecFlushRedisPattern(string pat2Flush)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("ExecFlushRedisPattern");
|
||||
string source = "REDIS";
|
||||
bool answ = false;
|
||||
var masterEndpoint = redisConn.GetEndPoints()
|
||||
.Where(ep => redisConn.GetServer(ep).IsConnected && !redisConn.GetServer(ep).IsReplica)
|
||||
.FirstOrDefault();
|
||||
|
||||
// sepattern è "*" elimino intero DB...
|
||||
if (masterEndpoint != null && (pat2Flush.Equals(new RedisValue("*")) || pat2Flush == RedisValue.Null))
|
||||
{
|
||||
redisConn.GetServer(masterEndpoint).FlushDatabase(database: redisDb.Database);
|
||||
}
|
||||
else
|
||||
{
|
||||
var server = redisConn.GetServer(masterEndpoint);
|
||||
var keys = server.Keys(database: redisDb.Database, pattern: pat2Flush, pageSize: 1000);
|
||||
var batch = new List<RedisKey>();
|
||||
foreach (var key in keys)
|
||||
{
|
||||
batch.Add(key);
|
||||
|
||||
// Flush in batches of 1000
|
||||
if (batch.Count >= 1000)
|
||||
{
|
||||
foreach (var item in batch)
|
||||
redisDb.KeyDelete(item);
|
||||
|
||||
batch.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
// Flush remaining keys
|
||||
foreach (var item in batch)
|
||||
redisDb.KeyDelete(item);
|
||||
}
|
||||
answ = true;
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"ExecFlushRedisPattern | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue flush memoria redis dato keyVal, async
|
||||
/// </summary>
|
||||
@@ -869,7 +821,7 @@ namespace MP.SPEC.Data
|
||||
/// Cancellazione FusionCache dato singolo tag
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> FlushCacheByTagAsync(string tag)
|
||||
public async Task<bool> FlushCacheAsync(string tag)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(tag)) return false;
|
||||
|
||||
@@ -882,7 +834,7 @@ namespace MP.SPEC.Data
|
||||
/// Cancellazione FusionCache dato elenco tags
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> FlushCacheByTagAsync(List<string> listTags)
|
||||
public async Task<bool> FlushCacheAsync(List<string> listTags)
|
||||
{
|
||||
if (listTags == null || listTags.Count == 0) return false;
|
||||
|
||||
@@ -897,19 +849,6 @@ namespace MP.SPEC.Data
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> FlushCacheFluxLog()
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("FlushCacheFluxLog");
|
||||
string source = "REDIS";
|
||||
bool answ = false;
|
||||
RedisValue pattern = new RedisValue($"{Utils.redisParetoFLKey}:*");
|
||||
answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"FlushCacheFluxLog | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Flush cache relativa a MP-IO x dati ODL
|
||||
/// </summary>
|
||||
@@ -932,23 +871,14 @@ namespace MP.SPEC.Data
|
||||
public async Task<bool> FlushRedisCache()
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("FlushRedisCache");
|
||||
string source = "REDIS";
|
||||
string source = "FUSION";
|
||||
// valutare se tenere
|
||||
RedisValue pattern = Utils.RedValue("*");
|
||||
bool answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
await ExecFlushRedisPatternAsync(pattern);
|
||||
// pulisco fusionlog cache...
|
||||
bool answ = await FlushCacheAsync();
|
||||
activity?.Stop();
|
||||
LogTrace($"FlushRedisCache | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
public async Task<bool> FlushRedisKey(string redKey)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("FlushRedisKey");
|
||||
string source = "REDIS";
|
||||
RedisValue pattern = Utils.RedValue(redKey);
|
||||
bool answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"FlushRedisKey | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"FlushCache | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -964,19 +894,24 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public async Task FluxLogDataRedux(string idxMaccSel, List<string> fluxList, DtUtils.Periodo currPeriodo, Enums.ValSelection valMode, Enums.DataInterval intReq, int maxItem)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("FluxLogDataRedux");
|
||||
string source = "DB+REDIS";
|
||||
List<StatDedupDTO> procStats = await dbController.FluxLogDataRedux(idxMaccSel, fluxList, currPeriodo, valMode, intReq, maxItem);
|
||||
using var activity = ActivitySource.StartActivity("FluxLogDataReduxAsync");
|
||||
string source = "DB";
|
||||
List<StatDedupDTO> procStats = await dbController.FluxLogDataReduxAsync(idxMaccSel, fluxList, currPeriodo, valMode, intReq, maxItem);
|
||||
// effettuo merge statistiche...
|
||||
ProcDedupStatMerge(procStats);
|
||||
await ProcDedupStatMergeAsync(procStats);
|
||||
// svuoto cache
|
||||
await FlushCacheFluxLog();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"FluxLogDataRedux | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"FluxLogDataReduxAsync | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
}
|
||||
|
||||
public List<FluxLogDTO> FluxLogDtoGetByFlux(string Valore)
|
||||
/// <summary>
|
||||
/// Helper conversione valore raw in List di FluxLogDTO
|
||||
/// </summary>
|
||||
/// <param name="Valore"></param>
|
||||
/// <returns></returns>
|
||||
public List<FluxLogDTO> FluxLogDtoConvert(string Valore)
|
||||
{
|
||||
List<FluxLogDTO> answ = new List<FluxLogDTO>();
|
||||
DossierFluxLogDTO? result = JsonConvert.DeserializeObject<DossierFluxLogDTO>(Valore);
|
||||
@@ -1050,15 +985,15 @@ namespace MP.SPEC.Data
|
||||
public async Task ForceDbMaint(bool doExec = true, bool doUpdStat = true, bool doSave = true, int minPgCnt = 1000, int minAvgFrag = 10, int maxAvgFragReb = 50)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("ForceDbMaint");
|
||||
string source = "DB+REDIS";
|
||||
string source = "DB";
|
||||
await dbController.ForceDbMaint(doExec, doUpdStat, doSave, minPgCnt, minAvgFrag, maxAvgFragReb);
|
||||
// svuoto cache
|
||||
await FlushCacheFluxLog();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"ForceDbMaint | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"ForceDbMaint | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
// registro statistiche esecuzione
|
||||
RecDbMaintStat(activity?.Duration ?? TimeSpan.FromSeconds(1));
|
||||
await RecDbMaintStatAsync(activity?.Duration ?? TimeSpan.FromSeconds(1));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1072,7 +1007,7 @@ namespace MP.SPEC.Data
|
||||
bool result = false;
|
||||
result = await dbController.Grp2MaccDeleteAsync(rec2del);
|
||||
// elimino cache redis...
|
||||
await ResetMacGrpCache();
|
||||
await FlushCacheMacGrp();
|
||||
activity?.SetTag("data.source", "DB");
|
||||
activity?.Stop();
|
||||
LogTrace($"Grp2MaccDeleteAsync | CodGruppo {rec2del.CodGruppo} | IdxMacc {rec2del.IdxMacchina} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -1090,7 +1025,7 @@ namespace MP.SPEC.Data
|
||||
bool result = false;
|
||||
result = await dbController.Grp2MaccInsertAsync(upsRec);
|
||||
// elimino cache redis...
|
||||
await ResetMacGrpCache();
|
||||
await FlushCacheMacGrp();
|
||||
activity?.SetTag("data.source", "DB");
|
||||
activity?.Stop();
|
||||
LogTrace($"Grp2MaccInsertAsync | CodGruppo {upsRec.CodGruppo} | IdxMacc {upsRec.IdxMacchina} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -1108,7 +1043,7 @@ namespace MP.SPEC.Data
|
||||
bool result = false;
|
||||
result = await dbController.Grp2OperDeleteAsync(rec2del);
|
||||
// elimino cache redis...
|
||||
await ResetOprGrpCache();
|
||||
await FlushCacheOprGrp();
|
||||
activity?.SetTag("data.source", "DB");
|
||||
activity?.Stop();
|
||||
LogTrace($"Grp2OperDeleteAsync | CodGruppo {rec2del.CodGruppo} | MatrOpr {rec2del.MatrOpr} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -1126,7 +1061,7 @@ namespace MP.SPEC.Data
|
||||
bool result = false;
|
||||
result = await dbController.Grp2OperInsertAsync(upsRec);
|
||||
// elimino cache redis...
|
||||
await ResetOprGrpCache();
|
||||
await FlushCacheOprGrp();
|
||||
activity?.SetTag("data.source", "DB");
|
||||
activity?.Stop();
|
||||
LogTrace($"Grp2OperInsertAsync | CodGruppo {upsRec.CodGruppo} | MatrOpr {upsRec.MatrOpr} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -1149,7 +1084,7 @@ namespace MP.SPEC.Data
|
||||
/// Elimina record + svuotamento cache
|
||||
/// </summary>
|
||||
/// <param name="currRecord"></param>
|
||||
public async Task<bool> IstKitDelete(IstanzeKitModel currRecord)
|
||||
public async Task<bool> IstKitDeleteAsync(IstanzeKitModel currRecord)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("IstKitDeleteAsync");
|
||||
string source = "DB";
|
||||
@@ -1204,7 +1139,7 @@ namespace MP.SPEC.Data
|
||||
/// Esegue salvataggio record + svuotamento cache
|
||||
/// </summary>
|
||||
/// <param name="currRecord"></param>
|
||||
public async Task<bool> IstKitUpsert(IstanzeKitModel currRecord)
|
||||
public async Task<bool> IstKitUpsertAsync(IstanzeKitModel currRecord)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("IstKitUpsertAsync");
|
||||
string source = "DB";
|
||||
@@ -1462,9 +1397,9 @@ namespace MP.SPEC.Data
|
||||
/// <param name="idxMacchina">idx idxMaccSel</param>
|
||||
/// <param name="matrOpr">matricola operatore</param>
|
||||
/// <param name="confPezzi">indica se confermare i pezzi priam di chiudere ODL</param>
|
||||
public async Task<bool> ODLClose(int idxOdl, string idxMacchina, int matrOpr, bool confPezzi)
|
||||
public async Task<bool> ODLCloseAsync(int idxOdl, string idxMacchina, int matrOpr, bool confPezzi)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("ODLClose");
|
||||
using var activity = ActivitySource.StartActivity("ODLCloseAsync");
|
||||
string source = "DB";
|
||||
bool fatto = false;
|
||||
|
||||
@@ -1482,11 +1417,13 @@ namespace MP.SPEC.Data
|
||||
int.TryParse(vModo, out modoConfProd);
|
||||
}
|
||||
// chiamo metodo conferma!
|
||||
fatto = await dbController.ODLClose(idxOdl, idxMacchina, matrOpr, confPezzi, confRett, modoConfProd);
|
||||
fatto = await dbController.ODLCloseAsync(idxOdl, idxMacchina, matrOpr, confPezzi, confRett, modoConfProd);
|
||||
|
||||
await FlushCacheAsync(Utils.redisOdlByKey);
|
||||
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"ODLClose | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"ODLCloseAsync | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
return fatto;
|
||||
}
|
||||
|
||||
@@ -1629,7 +1566,7 @@ namespace MP.SPEC.Data
|
||||
string source = "DB+REDIS";
|
||||
var dbResult = await dbController.PODLDeleteRecord(currRec);
|
||||
// elimino cache redis...
|
||||
await POdlFlushCache();
|
||||
await FlushCachePOdl();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"POdlDeleteRecord | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -1647,7 +1584,7 @@ namespace MP.SPEC.Data
|
||||
string source = "DB+REDIS";
|
||||
var dbResult = await dbController.PODL_startSetup(currRec, 0, 1, 1, "", DateTime.Now);
|
||||
// elimino cache redis...
|
||||
await POdlFlushCache();
|
||||
await FlushCachePOdl();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"POdlDoSetup | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -1661,6 +1598,15 @@ namespace MP.SPEC.Data
|
||||
/// <returns></returns>
|
||||
public async Task<PODLModel> POdlGetByKey(int idxPODL)
|
||||
{
|
||||
string currKey = $"{Utils.redisPOdlByPOdl}:{idxPODL}";
|
||||
return await GetOrFetchAsync(
|
||||
operationName: "POdlGetByKey",
|
||||
cacheKey: currKey,
|
||||
expiration: TimeSpan.FromMinutes(redisLongTimeCache),
|
||||
fetchFunc: async () => await dbController.PODL_getByKeyAsync(idxPODL) ?? new(),
|
||||
tagList: [Utils.redisPOdlByPOdl]
|
||||
);
|
||||
#if false
|
||||
PODLModel result = new PODLModel();
|
||||
if (idxPODL != 0)
|
||||
{
|
||||
@@ -1698,7 +1644,8 @@ namespace MP.SPEC.Data
|
||||
{
|
||||
Log.Debug("Errore IdxPODL = 0");
|
||||
}
|
||||
return result;
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1729,7 +1676,7 @@ namespace MP.SPEC.Data
|
||||
// salvo
|
||||
fatto = await dbController.PodlIstKitDeleteAsync(IdxPODL);
|
||||
// svuoto cache
|
||||
await FlushCacheByTagAsync(new List<string>() { Utils.redisPOdlList });
|
||||
await FlushCachePOdl();
|
||||
activity?.SetTag("data.source", "DB");
|
||||
return fatto;
|
||||
}
|
||||
@@ -1749,7 +1696,6 @@ namespace MP.SPEC.Data
|
||||
fetchFunc: async () => await dbController.ListPODL_ByKitParentAsync(IdxPodlParent) ?? new(),
|
||||
tagList: [Utils.redisPOdlList]
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1814,14 +1760,11 @@ namespace MP.SPEC.Data
|
||||
public async Task<bool> POdlUpdateRecipe(int idxPODL, string recipeName)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("POdlUpdateRecipe");
|
||||
string source = "DB+REDIS";
|
||||
string source = "DB";
|
||||
bool answ = false;
|
||||
answ = await dbController.PODL_updateRecipe(idxPODL, recipeName);
|
||||
// reset redis...
|
||||
if (answ)
|
||||
{
|
||||
await POdlFlushCache();
|
||||
}
|
||||
await FlushCachePOdl();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"POdlUpdateRecipe | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -1836,10 +1779,10 @@ namespace MP.SPEC.Data
|
||||
public async Task<bool> POdlUpdateRecord(PODLModel currRec)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("POdlUpdateRecord");
|
||||
string source = "DB+REDIS";
|
||||
var dbResult = await dbController.PODLUpdateRecord(currRec);
|
||||
string source = "DB";
|
||||
var dbResult = await dbController.PODLUpdateRecordAsync(currRec);
|
||||
// elimino cache redis...
|
||||
await POdlFlushCache();
|
||||
await FlushCachePOdl();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"POdlUpdateRecord | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -1850,14 +1793,14 @@ namespace MP.SPEC.Data
|
||||
/// Restituisce le statistiche di processo correnti x depluplica FluxLog
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<StatDedupDTO> ProcFLStats()
|
||||
public async Task<List<StatDedupDTO>> ProcFLStatsAsync()
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("ProcFLStats");
|
||||
using var activity = ActivitySource.StartActivity("ProcFLStatsAsync");
|
||||
string source = "REDIS";
|
||||
List<StatDedupDTO> actStats = new List<StatDedupDTO>();
|
||||
string currKey = $"{Utils.redisStatsProcFL}";
|
||||
// recupero i record statistiche correnti
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
var rawStats = JsonConvert.DeserializeObject<List<StatDedupDTO>>($"{rawData}");
|
||||
@@ -1868,7 +1811,7 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"ProcFLStats | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
LogTrace($"ProcFLStatsAsync | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
return actStats;
|
||||
}
|
||||
|
||||
@@ -1897,13 +1840,10 @@ namespace MP.SPEC.Data
|
||||
public async Task<bool> RecipeSetByPODL(RecipeModel currRecord)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("RecipeSetByPODL");
|
||||
string source = "DB+REDIS";
|
||||
string source = "MONGO";
|
||||
bool answ = false;
|
||||
answ = await mongoController.RecipeSetByPODL(currRecord);
|
||||
if (answ)
|
||||
{
|
||||
await POdlFlushCache();
|
||||
}
|
||||
await FlushCachePOdl();
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"RecipeSetByPODL | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -1995,15 +1935,27 @@ namespace MP.SPEC.Data
|
||||
/// Statistiche ODL calcolate (da stored stp_STAT_ODL)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Task<List<StatODLModel>> StatOdl(int IdxOdl)
|
||||
public async Task<List<StatODLModel>> OdlStatsAsync(int IdxOdl)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("StatOdl");
|
||||
string currKey = $"{Utils.redisOdlStats}:{IdxOdl}";
|
||||
|
||||
return await GetOrFetchAsync(
|
||||
operationName: "OdlStatsAsync",
|
||||
cacheKey: currKey,
|
||||
expiration: getRandTOut(redisShortTimeCache),
|
||||
fetchFunc: async () => await dbController.OdlGetStatAsync(IdxOdl) ?? new(),
|
||||
tagList: [Utils.redisOdlStats]
|
||||
);
|
||||
|
||||
#if false
|
||||
using var activity = ActivitySource.StartActivity("OdlStatsAsync");
|
||||
string source = "DB";
|
||||
var result = dbController.OdlStart(IdxOdl);
|
||||
var result = await dbController.OdlGetStatAsync(IdxOdl);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"StatOdl | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
LogTrace($"OdlStatsAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2034,8 +1986,8 @@ namespace MP.SPEC.Data
|
||||
string source = "DB";
|
||||
bool fatto = false;
|
||||
// salvo
|
||||
fatto = dbController.TemplateKitDelete(currRecord);
|
||||
await FlushCacheByTagAsync(Utils.redisKitTempl);
|
||||
fatto = await dbController.TemplateKitDeleteAsync(currRecord);
|
||||
await FlushCacheAsync(Utils.redisKitTempl);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"TemplateKitDeleteAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -2073,7 +2025,7 @@ namespace MP.SPEC.Data
|
||||
bool fatto = false;
|
||||
// salvo
|
||||
fatto = dbController.TemplateKitUpsert(currRecord, codAzienda);
|
||||
await FlushCacheByTagAsync(Utils.redisKitTempl);
|
||||
await FlushCacheAsync(Utils.redisKitTempl);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"TemplateKitUpsertAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -2156,7 +2108,7 @@ namespace MP.SPEC.Data
|
||||
// salvo
|
||||
fatto = await dbController.WipKitDeleteAsync(currRecord);
|
||||
// svuoto cache
|
||||
await FlushCacheByTagAsync(Utils.redisKitWip);
|
||||
await FlushCacheAsync(Utils.redisKitWip);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"WipKitDeleteAsync Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -2175,7 +2127,7 @@ namespace MP.SPEC.Data
|
||||
// salvo
|
||||
fatto = await dbController.WipKitDeleteOlderAsync(DateLimit);
|
||||
// svuoto cache KitWip
|
||||
await FlushCacheByTagAsync(Utils.redisKitWip);
|
||||
await FlushCacheAsync(Utils.redisKitWip);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"WipKitDeleteOlderAsync Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -2211,7 +2163,7 @@ namespace MP.SPEC.Data
|
||||
// salvo
|
||||
fatto = await dbController.WipKitUpsertAsync(currRecord);
|
||||
// svuoto cache KitWip
|
||||
await FlushCacheByTagAsync(Utils.redisKitWip);
|
||||
await FlushCacheAsync(Utils.redisKitWip);
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"WipKitUpsertAsync | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
@@ -2222,6 +2174,93 @@ namespace MP.SPEC.Data
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task<bool> FlushCacheArticoli()
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("FlushCacheArticoli");
|
||||
string source = "FUSION";
|
||||
bool answ = await FlushCacheAsync(new List<string>() { Utils.redisArtList, Utils.redisArtByDossier });
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"FlushCacheArticoli | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected async Task<bool> FlushCacheConfig()
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("FlushCacheConfig");
|
||||
string source = "FUSION";
|
||||
bool answ = await FlushCacheAsync(new List<string>() { Utils.redisConfKey });
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"FlushCacheConfig | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset macchine e gruppi
|
||||
/// </summary>
|
||||
protected async Task<bool> FlushCacheMacGrp()
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("FlushCacheMacGrp");
|
||||
string source = "FUSION";
|
||||
bool answ = await FlushCacheAsync(new List<string> { Utils.redisAnagGruppi, Utils.redisMacList });
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"FlushCacheMacGrp | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset cache operatori e gruppi
|
||||
/// </summary>
|
||||
protected async Task<bool> FlushCacheOprGrp()
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("FlushCacheOprGrp");
|
||||
string source = "FUSION";
|
||||
bool answ = await FlushCacheAsync(new List<string> { Utils.redisAnagGruppi, Utils.redisOprList });
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"FlushCacheOprGrp | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected async Task<bool> FlushCachePOdl()
|
||||
{
|
||||
#if false
|
||||
using var activity = ActivitySource.StartActivity("POdlFlushCache");
|
||||
bool answ = false;
|
||||
RedisValue pattern = new RedisValue($"{Utils.redisXdlData}:*");
|
||||
answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
pattern = new RedisValue($"{Utils.redisPOdlByOdl}:*");
|
||||
answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
pattern = new RedisValue($"{Utils.redisPOdlByPOdl}:*");
|
||||
answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
pattern = new RedisValue($"{Utils.redisPOdlList}:*");
|
||||
answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
activity?.SetTag("data.source", "REDIS");
|
||||
return answ;
|
||||
#endif
|
||||
|
||||
using var activity = ActivitySource.StartActivity("FlushCachePOdl");
|
||||
string source = "FUSION";
|
||||
bool answ = await FlushCacheAsync(new List<string>() { Utils.redisXdlData, Utils.redisPOdlByOdl, Utils.redisPOdlByPOdl, Utils.redisPOdlList });
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"FlushCachePOdl | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected async Task<bool> FlushKitCache()
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("FlushKitCache");
|
||||
string source = "FUSION";
|
||||
bool answ = await FlushCacheAsync(new List<string>() { Utils.redisPOdlList, Utils.redisKitInst, Utils.redisKitWip, Utils.redisKitScore, Utils.redisPOdlByCodArt });
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"FlushKitCache | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce un timeout dal valore secondi richiesti + tempo random +/-3%
|
||||
/// </summary>
|
||||
@@ -2234,66 +2273,20 @@ namespace MP.SPEC.Data
|
||||
return TimeSpan.FromSeconds(rValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Merge statistiche Dedup
|
||||
/// </summary>
|
||||
/// <param name="procStats"></param>
|
||||
/// <returns></returns>
|
||||
protected bool ProcDedupStatMerge(List<StatDedupDTO> procStats)
|
||||
{
|
||||
bool answ = false;
|
||||
List<StatDedupDTO> actStats = ProcFLStats();
|
||||
// se fosse vuoto --> add diretto
|
||||
if (actStats.Count == 0)
|
||||
{
|
||||
actStats.AddRange(procStats);
|
||||
}
|
||||
else
|
||||
{
|
||||
// aggiorno su redis i record statistiche 1:1...
|
||||
foreach (var recStat in procStats)
|
||||
{
|
||||
// cerco se ci fosse x aggiornare
|
||||
var currRec = actStats.Where(x => x.IdxMacchina == recStat.IdxMacchina
|
||||
&& x.CodFlux == recStat.CodFlux
|
||||
&& x.Interval == recStat.Interval
|
||||
&& x.Num4Int == recStat.Num4Int).FirstOrDefault();
|
||||
// se trovato aggiorno
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec.ProcTime += recStat.ProcTime;
|
||||
currRec.NumRec += recStat.NumRec;
|
||||
}
|
||||
// altrimenti aggiungo
|
||||
else
|
||||
{
|
||||
actStats.Add(recStat);
|
||||
}
|
||||
}
|
||||
}
|
||||
// salvo record statistiche
|
||||
var rawData = JsonConvert.SerializeObject(actStats);
|
||||
string currKey = $"{Utils.redisStatsProcFL}";
|
||||
redisDb.StringSet(currKey, rawData);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Merge statistiche DB Maintenance
|
||||
/// </summary>
|
||||
/// <param name="procStats"></param>
|
||||
/// <returns></returns>
|
||||
protected bool RecDbMaintStat(TimeSpan duration)
|
||||
protected async Task<bool> RecDbMaintStatAsync(TimeSpan duration)
|
||||
{
|
||||
bool answ = false;
|
||||
Dictionary<DateTime, double> actStats = DbDedupStats();
|
||||
Dictionary<DateTime, double> actStats = await DbDedupStatsAsync();
|
||||
// aggiungo record!
|
||||
actStats.Add(DateTime.Now, duration.TotalSeconds);
|
||||
// salvo NUOVO record statistiche
|
||||
string currKey = $"{Utils.redisStatsDbMaint}";
|
||||
var rawData = JsonConvert.SerializeObject(actStats);
|
||||
redisDb.StringSet(currKey, rawData);
|
||||
return answ;
|
||||
return await redisDb.StringSetAsync(currKey, rawData);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
@@ -2390,9 +2383,15 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
}
|
||||
|
||||
private async Task FlushKitCache()
|
||||
private async Task<bool> FlushCacheFluxLog()
|
||||
{
|
||||
await FlushCacheByTagAsync(new List<string>() { Utils.redisPOdlList, Utils.redisKitInst, Utils.redisKitWip, Utils.redisKitScore, Utils.redisPOdlByCodArt });
|
||||
using var activity = ActivitySource.StartActivity("FlushCacheFluxLog");
|
||||
string source = "FUSION";
|
||||
bool answ = await FlushCacheAsync(new List<string>() { Utils.redisFluxLogFilt, Utils.redisParetoFLKey });
|
||||
activity?.SetTag("data.source", source);
|
||||
activity?.Stop();
|
||||
LogTrace($"FlushCacheFluxLog | {source} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2477,20 +2476,46 @@ namespace MP.SPEC.Data
|
||||
Log.Log(reqLevel, traceMsg);
|
||||
}
|
||||
|
||||
private async Task<bool> POdlFlushCache()
|
||||
/// <summary>
|
||||
/// Merge statistiche Dedup
|
||||
/// </summary>
|
||||
/// <param name="procStats"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<bool> ProcDedupStatMergeAsync(List<StatDedupDTO> procStats)
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("POdlFlushCache");
|
||||
bool answ = false;
|
||||
RedisValue pattern = new RedisValue($"{Utils.redisXdlData}:*");
|
||||
answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
pattern = new RedisValue($"{Utils.redisPOdlByOdl}:*");
|
||||
answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
pattern = new RedisValue($"{Utils.redisPOdlByPOdl}:*");
|
||||
answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
pattern = new RedisValue($"{Utils.redisPOdlList}:*");
|
||||
answ = await ExecFlushRedisPatternAsync(pattern);
|
||||
activity?.SetTag("data.source", "REDIS");
|
||||
return answ;
|
||||
List<StatDedupDTO> actStats = await ProcFLStatsAsync();
|
||||
// se fosse vuoto --> add diretto
|
||||
if (actStats.Count == 0)
|
||||
{
|
||||
actStats.AddRange(procStats);
|
||||
}
|
||||
else
|
||||
{
|
||||
// aggiorno su redis i record statistiche 1:1...
|
||||
foreach (var recStat in procStats)
|
||||
{
|
||||
// cerco se ci fosse x aggiornare
|
||||
var currRec = actStats.Where(x => x.IdxMacchina == recStat.IdxMacchina
|
||||
&& x.CodFlux == recStat.CodFlux
|
||||
&& x.Interval == recStat.Interval
|
||||
&& x.Num4Int == recStat.Num4Int).FirstOrDefault();
|
||||
// se trovato aggiorno
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec.ProcTime += recStat.ProcTime;
|
||||
currRec.NumRec += recStat.NumRec;
|
||||
}
|
||||
// altrimenti aggiungo
|
||||
else
|
||||
{
|
||||
actStats.Add(recStat);
|
||||
}
|
||||
}
|
||||
}
|
||||
// salvo record statistiche
|
||||
var rawData = JsonConvert.SerializeObject(actStats);
|
||||
string currKey = $"{Utils.redisStatsProcFL}";
|
||||
return await redisDb.StringSetAsync(currKey, rawData);
|
||||
}
|
||||
|
||||
private string redHashMpIO(string keyName)
|
||||
@@ -2508,44 +2533,6 @@ namespace MP.SPEC.Data
|
||||
return result;
|
||||
}
|
||||
|
||||
private async Task resetCacheArticoli()
|
||||
{
|
||||
using var activity = ActivitySource.StartActivity("resetCacheArticoli");
|
||||
RedisValue pattern = new RedisValue($"{Utils.redisArtByDossier}:*");
|
||||
await ExecFlushRedisPatternAsync(pattern);
|
||||
pattern = new RedisValue($"{Utils.redisArtList}:*");
|
||||
await ExecFlushRedisPatternAsync(pattern);
|
||||
// elimino anche in FusionCache
|
||||
List<string> tags2del = new List<string>() { Utils.redisArtList, Utils.redisArtByDossier };
|
||||
await FlushCacheByTagAsync(tags2del);
|
||||
activity?.SetTag("data.source", "REDIS");
|
||||
}
|
||||
|
||||
private async Task ResetConfigCache()
|
||||
{
|
||||
await redisDb.StringSetAsync(Utils.redisConfKey, "");
|
||||
List<string> tags2del = new List<string>() { Utils.redisConfKey };
|
||||
await FlushCacheByTagAsync(tags2del);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset macchine e gruppi
|
||||
/// </summary>
|
||||
private async Task ResetMacGrpCache()
|
||||
{
|
||||
await FlushCacheByTagAsync(new List<string> { Utils.redisAnagGruppi, Utils.redisMacList });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset cache operatori e gruppi
|
||||
/// </summary>
|
||||
private async Task ResetOprGrpCache()
|
||||
{
|
||||
//ExecFlushRedisPattern($"{Utils.redisAnagGruppi}:*");
|
||||
//ExecFlushRedisPattern($"{Utils.redisOprList}:*");
|
||||
await FlushCacheByTagAsync(new List<string> { Utils.redisAnagGruppi, Utils.redisOprList });
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>8.16.2605.3010</Version>
|
||||
<Version>8.16.2605.3012</Version>
|
||||
<UserSecretsId>1800a78a-6ff1-40f9-b490-87fb8bfc1394</UserSecretsId>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace MP.SPEC.Pages
|
||||
await MDataServ.FluxLogDataRedux(idxMaccSel, new List<string> { item }, CurrPeriodo, ValMode, IntReq, NumItem);
|
||||
currStep++;
|
||||
}
|
||||
//await MDataServ.FluxLogDataRedux(idxMaccSel, fluxList, CurrPeriodo, ValMode, IntReq, maxItem);
|
||||
//await MDataServ.FluxLogDataReduxAsync(idxMaccSel, fluxList, CurrPeriodo, ValMode, IntReq, maxItem);
|
||||
sw.Stop();
|
||||
lastDedupExecTime = $"{sw.Elapsed.Minutes}m {sw.Elapsed.Seconds}s";
|
||||
isProcessing = false;
|
||||
@@ -122,7 +122,7 @@ namespace MP.SPEC.Pages
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ReloadStats();
|
||||
await ReloadStatsAsync();
|
||||
await ReloadDataAsync();
|
||||
}
|
||||
|
||||
@@ -226,10 +226,10 @@ namespace MP.SPEC.Pages
|
||||
CurrPeriodo = new Periodo(dtStart, dtEnd);
|
||||
}
|
||||
|
||||
private void ReloadStats()
|
||||
private async Task ReloadStatsAsync()
|
||||
{
|
||||
actProcDedupStats = MDataServ.ProcFLStats();
|
||||
actDbMaintStats = MDataServ.DbDedupStats();
|
||||
actProcDedupStats = await MDataServ.ProcFLStatsAsync();
|
||||
actDbMaintStats = await MDataServ.DbDedupStatsAsync();
|
||||
}
|
||||
|
||||
private void updateExpTime()
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace MP.SPEC.Pages
|
||||
// se deve essere autogenerato da counter...
|
||||
if (AutoGen)
|
||||
{
|
||||
var cntRec = MDService.AnagCountersGetNext("NumKitArt");
|
||||
var cntRec = await MDService.AnagCountersGetNextAsync("NumKitArt");
|
||||
if (cntRec != null)
|
||||
{
|
||||
codParent = $"{cntRec.CntCode}{cntRec.LastNum:000000}";
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace MP.SPEC.Pages
|
||||
return;
|
||||
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.IstKitDelete(selRec);
|
||||
var done = await MDService.IstKitDeleteAsync(selRec);
|
||||
EditRecord = null;
|
||||
await ResetDataAsync();
|
||||
}
|
||||
@@ -141,7 +141,7 @@ namespace MP.SPEC.Pages
|
||||
return;
|
||||
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.IstKitUpsert(selRec);
|
||||
var done = await MDService.IstKitUpsertAsync(selRec);
|
||||
EditRecord = null;
|
||||
await ResetDataAsync();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 8.16.2605.3010</h4>
|
||||
<h4>Versione: 8.16.2605.3012</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2605.3010
|
||||
8.16.2605.3012
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2605.3010</version>
|
||||
<version>8.16.2605.3012</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
+10
-6
@@ -9,7 +9,7 @@ Migrare la logica di caching manuale (Redis + DB) verso l'utilizzo di `IFusionCa
|
||||
|
||||
## Strategia di Migrazione
|
||||
- **Metodo Standard**: `GetOrFetchAsync<T>(string operationName, string cacheKey, Func<Task<T>> fetchFunc, TimeSpan expiration, params string[] tagList)`.
|
||||
- **Invalidazione**: Utilizzare i tag tramite `FlushCacheByTagsAsync`.
|
||||
- **Invalidazione**: Utilizzare i tag tramite `FlushCacheByTagAsync`.
|
||||
|
||||
## Stato Avanzamento
|
||||
|
||||
@@ -71,12 +71,15 @@ Migrare la logica di caching manuale (Redis + DB) verso l'utilizzo di `IFusionCa
|
||||
- [ ] Migrazione di `ActionSetReq` (linea 136: usa `BroadastMsgPipe.saveAndSendMessage`).
|
||||
- [ ] Migrazione di `ArticoliDeleteRecord`/`UpdateRecord` (linea 296/372: usa `resetCacheArticoli`).
|
||||
- [ ] Migrazione di `DbDedupStats` (linea 516: usa `redisDb.StringGet`).
|
||||
- [ ] Migrazione di `DossiersDeleteRecord` (linea 554: usa `ExecFlushRedisPatternAsync`).
|
||||
- [ ] Migrazione di `DossiersTakeParamsSnapshotLast` (linea 613: usa `ExecFlushRedisPatternAsync`).
|
||||
- [ ] Migrazione di `DossiersDeleteRecord` (linea 551: usa `ExecFlushRedisPatternAsync`).
|
||||
- [ ] Migrazione di `DossiersTakeParamsSnapshotLast` (linea 610: usa `ExecFlushRedisPatternAsync`).
|
||||
- [ ] Migrazione di `ElencoRepartiDTO` (linea 697: usa `redisDb.StringGet` e `StringSet`).
|
||||
- [ ] Migrazione di `PodlIstKitDelete` (linea 1842: usa `ExecFlushRedisPattern`).
|
||||
- [ ] Migrazione di `POdlListByKitParent` (linea 1863: usa `redisDb.StringGet` e `StringSet`).
|
||||
- [ ] Migrazione di `ProcFLStats` (linea 1992: usa `redisDb.StringSet`).
|
||||
- [ ] Migrazione di `PodlIstKitDelete` (linea 1760: usa `ExecFlushRedisPattern` sincrono).
|
||||
- [ ] Migrazione di `POdlListByKitParent` (linea 1781: usa `redisDb.StringGet` e `StringSet`).
|
||||
- [ ] Migrazione di `POdlGetByKey` (linea 1662: usa `redisDb.StringGet` e `StringSet`).
|
||||
- [ ] Migrazione di `POdlUpdateRecipe` (linea 1814: usa `POdlFlushCache` con pattern).
|
||||
- [ ] Migrazione di `POdlUpdateRecord` (linea 1836: usa `POdlFlushCache` con pattern).
|
||||
- [ ] Migrazione di `ProcFLStats` (linea 1853: usa `redisDb.StringGet`).
|
||||
- [ ] Migrazione di `RecDbMaintStat` (linea 2451: usa `redisDb.StringSet`).
|
||||
|
||||
*(Nota: Il vecchio metodo `VocabolarioGetAll` e la gestione manuale del dizionario sono stati rimossi in favore di `Traduci` con FusionCache).*
|
||||
@@ -94,3 +97,4 @@ Migrare la logica di caching manuale (Redis + DB) verso l'utilizzo di `IFusionCa
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user