Fix problema adapter STATS
This commit is contained in:
@@ -13,7 +13,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Stats.Data
|
||||
{
|
||||
public class MpStatsService : BaseServ, IDisposable
|
||||
public class MpStatsService : BaseServ
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
@@ -23,17 +23,10 @@ namespace MP.Stats.Data
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MpStatsService(IConfiguration configuration) : base(configuration)
|
||||
public MpStatsService(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn)
|
||||
{
|
||||
Stopwatch sw = Stopwatch.StartNew();
|
||||
sw.Start();
|
||||
#if false
|
||||
_configuration = configuration;
|
||||
|
||||
// setup compoenti REDIS
|
||||
redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis"));
|
||||
redisDb = redisConn.GetDatabase();
|
||||
#endif
|
||||
|
||||
// conf DB
|
||||
string connStr = _configuration.GetConnectionString("MP.Stats");
|
||||
@@ -201,15 +194,6 @@ namespace MP.Stats.Data
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database controller
|
||||
dbController.Dispose();
|
||||
// redis dispose
|
||||
redisConn = null;
|
||||
redisDb = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pulizia cache Redis (tutta)
|
||||
/// </summary>
|
||||
@@ -777,7 +761,6 @@ namespace MP.Stats.Data
|
||||
#region Protected Fields
|
||||
|
||||
protected static string connStringBBM = "";
|
||||
|
||||
protected static string connStringFatt = "";
|
||||
|
||||
/// <summary>
|
||||
@@ -787,20 +770,26 @@ namespace MP.Stats.Data
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS
|
||||
/// </summary>
|
||||
protected ConnectionMultiplexer redisConn = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto DB redis da impiegare x chiamate R/W
|
||||
/// </summary>
|
||||
protected IDatabase redisDb = null!;
|
||||
#endif
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposed)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
// Free managed resources here
|
||||
dbController.Dispose();
|
||||
}
|
||||
|
||||
// Free unmanaged resources here
|
||||
_disposed = true;
|
||||
}
|
||||
|
||||
// Call base class implementation.
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
protected string getCacheKey(string TableName, SelectData CurrFilter)
|
||||
{
|
||||
string answ = $"{TableName}:M_{CurrFilter.IdxMacchina}:AZ_{CurrFilter.Azione}:ART_{CurrFilter.CodArticolo}:KR_{CurrFilter.KeyRichiesta}:O_{CurrFilter.IdxOdl}:D_{CurrFilter.DateStart:yyyyMMddHHmm}_{CurrFilter.DateEnd:yyyyMMddHHmm}";
|
||||
@@ -818,6 +807,7 @@ namespace MP.Stats.Data
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private bool _disposed = false;
|
||||
private string redisBaseKey = "MP:STATS";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Stats</RootNamespace>
|
||||
<UserSecretsId>826e877c-ba70-4253-84cb-d0b1cafd4440</UserSecretsId>
|
||||
<Version>6.16.2507.1613</Version>
|
||||
<Version>6.16.2507.1613</Version>
|
||||
<Version>6.16.2507.2411</Version>
|
||||
<Version>6.16.2507.2411</Version>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<NoWarn>$(NoWarn);1591</NoWarn>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo statistiche MAPO</i>
|
||||
<h4>Versione: 6.16.2507.1613</h4>
|
||||
<h4>Versione: 6.16.2507.2411</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2507.1613
|
||||
6.16.2507.2411
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2507.1613</version>
|
||||
<version>6.16.2507.2411</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -51,10 +51,10 @@
|
||||
]
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
//"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
//"MP.Stats": "Server=SQL2016DEV;Database=MoonPro_STATS;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;",
|
||||
"DefaultConnection": "Server=SQL2016DEV;Database=Jetco_MoonPro_STATS_Prod;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
"MP.Stats": "Server=SQL2022PROD;Database=Jetco_MoonPro_STATS_Prod;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;",
|
||||
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
"MP.Stats": "Server=SQL2016DEV;Database=MoonPro_STATS;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;",
|
||||
//"DefaultConnection": "Server=SQL2016DEV;Database=Jetco_MoonPro_STATS_Prod;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
//"MP.Stats": "Server=SQL2022PROD;Database=Jetco_MoonPro_STATS_Prod;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;",
|
||||
"MP.Voc": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;",
|
||||
"Redis": "redis.ufficio:26379,serviceName=devel,DefaultDatabase=5,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,allowAdmin=true"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user