Update gestione memLayer x cache appConf in REDIS
This commit is contained in:
Vendored
+1
-1
@@ -10,7 +10,7 @@ pipeline {
|
||||
steps {
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=639']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=640']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '3.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '3.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'SteamWareLib'
|
||||
|
||||
+49
-15
@@ -129,7 +129,9 @@ namespace SteamWare
|
||||
/// </summary>
|
||||
public void resetAppConf()
|
||||
{
|
||||
redFlushKey(ACBH);
|
||||
#if false
|
||||
redFlushKey(ACBH);
|
||||
#endif
|
||||
startupAppConf();
|
||||
}
|
||||
/// <summary>
|
||||
@@ -160,14 +162,18 @@ namespace SteamWare
|
||||
valori[i] = new KeyValuePair<string, string>(item.Key, item.Value);
|
||||
i++;
|
||||
}
|
||||
redSaveHash(ACBH, valori);
|
||||
// salvo in redis valori (con TTL)
|
||||
redSaveHash(ACBH, valori, maxAgeAppConf);
|
||||
#if false
|
||||
redSaveHash(ACBH, valori);
|
||||
lastUpdateAppConf = DateTime.Now;
|
||||
#endif
|
||||
logger.lg.scriviLog("Completato procedura startupAppConf ", tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in startupAppConf:{0}{1}", Environment.NewLine, exc));
|
||||
logger.lg.scriviLog(string.Format("Errore in startupAppConf:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -210,6 +216,7 @@ namespace SteamWare
|
||||
logger.lg.scriviLog(string.Format("Effettuata procedura ricaricaAppConf per {0} records", answ.Count), tipoLog.INFO);
|
||||
return answ;
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// ultimo update in cache dei valori di AppConfig
|
||||
/// </summary>
|
||||
@@ -230,7 +237,29 @@ namespace SteamWare
|
||||
setCacheVal("lastUpdateAppConf", value, true);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Recupera il TTL x appConf (secondi)
|
||||
/// </summary>
|
||||
public int maxAgeAppConf
|
||||
{
|
||||
get
|
||||
{
|
||||
// default 5 minuti x refresh...
|
||||
int maxAge = 5;
|
||||
try
|
||||
{
|
||||
maxAge = confReadInt("maxAgeAppConf_min");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in lettura valore maxAgeAppConf_min{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return maxAge * 60;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configurations da tabella DB Config
|
||||
/// </summary>
|
||||
@@ -253,6 +282,7 @@ namespace SteamWare
|
||||
{
|
||||
resetAppConf();
|
||||
}
|
||||
#if false
|
||||
// default 5 minuti x refresh...
|
||||
int maxAge = 5;
|
||||
try
|
||||
@@ -262,12 +292,14 @@ namespace SteamWare
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in lettura chiave [{0}] durante configDbVal{1}{2}", chiave, Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
// controllo SE � passato pi� di 5 minuti, nel caso faccio refresh...
|
||||
}
|
||||
// controllo SE sia passato piu di maxAge minuti, nel caso faccio refresh...
|
||||
if (DateTime.Now.Subtract(lastUpdateAppConf).TotalMinutes > maxAge)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Scaduta validita appConf --> reset! (lastUpdate: {0} | maxAge: {1})", lastUpdateAppConf, maxAge), tipoLog.EXCEPTION);
|
||||
resetAppConf();
|
||||
}
|
||||
#endif
|
||||
// provo a leggere da DICT
|
||||
try
|
||||
{
|
||||
@@ -1448,7 +1480,7 @@ namespace SteamWare
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in getRSV:{0}{1}", Environment.NewLine, exc));
|
||||
logger.lg.scriviLog(string.Format("Errore in getRSV:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -1468,7 +1500,7 @@ namespace SteamWare
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in setRSV:{0}{1}", Environment.NewLine, exc));
|
||||
logger.lg.scriviLog(string.Format("Errore in setRSV:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -1491,7 +1523,7 @@ namespace SteamWare
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in setRSV:{0}{1}", Environment.NewLine, exc));
|
||||
logger.lg.scriviLog(string.Format("Errore in setRSV:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -1509,7 +1541,7 @@ namespace SteamWare
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in setRCI:{0}{1}", Environment.NewLine, exc));
|
||||
logger.lg.scriviLog(string.Format("Errore in setRCI:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -1527,7 +1559,7 @@ namespace SteamWare
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in setRCD:{0}{1}", Environment.NewLine, exc));
|
||||
logger.lg.scriviLog(string.Format("Errore in setRCD:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -1547,7 +1579,7 @@ namespace SteamWare
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in getRSV:{0}{1}", Environment.NewLine, exc));
|
||||
logger.lg.scriviLog(string.Format("Errore in getRSV:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answInt;
|
||||
}
|
||||
@@ -1565,7 +1597,7 @@ namespace SteamWare
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in resetRCnt:{0}{1}", Environment.NewLine, exc));
|
||||
logger.lg.scriviLog(string.Format("Errore in resetRCnt:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -1583,7 +1615,7 @@ namespace SteamWare
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in getRKeys:{0}{1}", Environment.NewLine, exc));
|
||||
logger.lg.scriviLog(string.Format("Errore in getRKeys:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -1602,7 +1634,7 @@ namespace SteamWare
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in setRKeys:{0}{1}", Environment.NewLine, exc));
|
||||
logger.lg.scriviLog(string.Format("Errore in setRKeys:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -1620,7 +1652,9 @@ namespace SteamWare
|
||||
answ = cache.HashGetAll(key).Length > 0;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{ }
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in redHashPresent per la key {2}:{0}{1}", Environment.NewLine, exc, key), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user