inizio refactor metodo log num chiamate redis
This commit is contained in:
Vendored
+1
-1
@@ -18,7 +18,7 @@ pipeline {
|
||||
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=1237']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=1238']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '6.6.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '6.6.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'MAPO'
|
||||
|
||||
+36
-59
@@ -220,6 +220,29 @@ namespace MapoDb
|
||||
|
||||
#endregion
|
||||
|
||||
#region utility interne
|
||||
|
||||
/// <summary>
|
||||
/// registra su REDIS eventuale superamento numero limite di call x il metodo in oggetto
|
||||
/// </summary>
|
||||
/// <param name="callCountKey"></param>
|
||||
private static void saveCallRec(string callCountKey)
|
||||
{
|
||||
// conto la richiesta nel contatore REDIS
|
||||
long nCall = memLayer.ML.setRCntI(mHash($"COUNT:pCall:{callCountKey}"));
|
||||
//... se == nCall2Log scrivo su log e resetto
|
||||
long nCall2Log = memLayer.ML.cdvi("nCall2Log");
|
||||
if (nCall >= nCall2Log)
|
||||
{
|
||||
// loggo
|
||||
logger.lg.scriviLog($"{callCountKey}: {nCall} call received", tipoLog.INFO);
|
||||
// resetto!
|
||||
memLayer.ML.resetRCnt(mHash($"COUNT:pCall:{callCountKey}"));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region utility public esposte
|
||||
|
||||
/// <summary>
|
||||
@@ -459,17 +482,7 @@ namespace MapoDb
|
||||
// registro conteggio impiego chiamate REDIS
|
||||
if (memLayer.ML.CRB("IOB_RedEnab"))
|
||||
{
|
||||
// conto la richiesta nel contatore REDIS
|
||||
long nCall = memLayer.ML.setRCntI(mHash("COUNT:pCall:processInput"));
|
||||
//... se == nCall2Log scrivo su log e resetto
|
||||
long nCall2Log = memLayer.ML.cdvi("nCall2Log");
|
||||
if (nCall >= nCall2Log)
|
||||
{
|
||||
// loggo
|
||||
logger.lg.scriviLog(string.Format("processInput: effettuate {0} call", nCall), tipoLog.INFO);
|
||||
// resetto!
|
||||
memLayer.ML.resetRCnt(mHash("COUNT:pCall:processInput"));
|
||||
}
|
||||
saveCallRec("processInput");
|
||||
}
|
||||
DateTime dataOraEvento = DateTime.Now;
|
||||
DateTime dtEvento, dtCorrente;
|
||||
@@ -710,17 +723,7 @@ namespace MapoDb
|
||||
// registro conteggio impiego chiamate REDIS
|
||||
if (memLayer.ML.CRB("IOB_RedEnab"))
|
||||
{
|
||||
// conto la richiesta nel contatore REDIS
|
||||
long nCall = memLayer.ML.setRCntI(mHash("COUNT:pCall:processFluxLog"));
|
||||
//... se == nCall2Log scrivo su log e resetto
|
||||
long nCall2Log = memLayer.ML.cdvi("nCall2Log");
|
||||
if (nCall >= nCall2Log)
|
||||
{
|
||||
// loggo
|
||||
logger.lg.scriviLog(string.Format("processFluxLog: effettuate {0} call", nCall), tipoLog.INFO);
|
||||
// resetto!
|
||||
memLayer.ML.resetRCnt(mHash("COUNT:pCall:processFluxLog"));
|
||||
}
|
||||
saveCallRec("processFluxLog");
|
||||
}
|
||||
string answ = "";
|
||||
DateTime dataOraEvento = DateTime.Now;
|
||||
@@ -798,17 +801,7 @@ namespace MapoDb
|
||||
// registro conteggio impiego chiamate REDIS
|
||||
if (memLayer.ML.CRB("IOB_RedEnab"))
|
||||
{
|
||||
// conto la richiesta nel contatore REDIS
|
||||
long nCall = memLayer.ML.setRCntI(mHash("COUNT:pCall:processLiveRec"));
|
||||
//... se == nCall2Log scrivo su log e resetto
|
||||
long nCall2Log = memLayer.ML.cdvi("nCall2Log");
|
||||
if (nCall >= nCall2Log)
|
||||
{
|
||||
// loggo
|
||||
logger.lg.scriviLog(string.Format("processLiveRec: effettuate {0} call", nCall), tipoLog.INFO);
|
||||
// resetto!
|
||||
memLayer.ML.resetRCnt(mHash("COUNT:pCall:processLiveRec"));
|
||||
}
|
||||
saveCallRec("processLiveRec");
|
||||
}
|
||||
string answ = "";
|
||||
DateTime dataOraEvento = DateTime.Now;
|
||||
@@ -884,17 +877,7 @@ namespace MapoDb
|
||||
// registro conteggio impiego chiamate REDIS
|
||||
if (memLayer.ML.CRB("IOB_RedEnab"))
|
||||
{
|
||||
// conto la richiesta nel contatore REDIS
|
||||
long nCall = memLayer.ML.setRCntI(mHash("COUNT:pCall:saveCounter"));
|
||||
//... se == nCall2Log scrivo su log e resetto
|
||||
long nCall2Log = memLayer.ML.cdvi("nCall2Log");
|
||||
if (nCall >= nCall2Log)
|
||||
{
|
||||
// loggo
|
||||
logger.lg.scriviLog(string.Format("saveCounter: effettuate {0} call", nCall), tipoLog.INFO);
|
||||
// resetto!
|
||||
memLayer.ML.resetRCnt(mHash("COUNT:pCall:saveCounter"));
|
||||
}
|
||||
saveCallRec("saveCounter");
|
||||
}
|
||||
string answ = "";
|
||||
// inizio processing vero e proprio INPUT...
|
||||
@@ -1422,28 +1405,18 @@ namespace MapoDb
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce il valore dell'ODL corrente (ODL deve esserci per gestione contapezzi, senza ODL NO invio/gestione ODL)
|
||||
/// Restituisce il valore dell'intera RIGA ODL corrente (da redis o da DB se non trovata...)
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public static string currODLRow(string idxMacchina)
|
||||
public static DS_ProdTempi.ODLRow currODLRow(string idxMacchina)
|
||||
{
|
||||
string answ = "";
|
||||
DS_ProdTempi.ODLRow answ = null;
|
||||
string rCall = "";
|
||||
if (memLayer.ML.CRB("IOB_RedEnab"))
|
||||
{
|
||||
saveCallRec("hasODL_row");
|
||||
|
||||
// conto la richiesta nel contatore REDIS
|
||||
long nCall = memLayer.ML.setRCntI(mHash("COUNT:pCall:hasODL"));
|
||||
//... se == nCall2Log scrivo su log e resetto
|
||||
long nCall2Log = memLayer.ML.cdvi("nCall2Log");
|
||||
if (nCall >= nCall2Log)
|
||||
{
|
||||
// loggo
|
||||
logger.lg.scriviLog(string.Format("IOB {1} | hasODL: effettuate {0} call", nCall, idxMacchina), tipoLog.INFO);
|
||||
// resetto!
|
||||
memLayer.ML.resetRCnt(mHash("COUNT:pCall:hasODL"));
|
||||
}
|
||||
try
|
||||
{
|
||||
rCall = memLayer.ML.getRSV(currODLHash(idxMacchina));
|
||||
@@ -1453,7 +1426,7 @@ namespace MapoDb
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = MapoDb.obj.currODL(idxMacchina);
|
||||
answ = MapoDb.obj.currODLRow(idxMacchina);
|
||||
// salvo in redis...
|
||||
saveCurrODL(idxMacchina, answ);
|
||||
}
|
||||
@@ -1461,6 +1434,10 @@ namespace MapoDb
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = MapoDb.obj.currODLRow(idxMacchina);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
@@ -456,6 +456,7 @@ namespace MapoDb
|
||||
public DS_ProdTempi.ODLRow currODLRow(string idxMacchina)
|
||||
{
|
||||
DS_ProdTempi.ODLRow answ = null;
|
||||
logger.lg.scriviLog("Recupero currODLRow da DB!", tipoLog.INFO);
|
||||
// recupero con stored NUOVA...
|
||||
DS_ProdTempi.ODLDataTable tabOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina);
|
||||
if (tabOdl.Rows.Count > 0)
|
||||
|
||||
Reference in New Issue
Block a user