Compare commits
11 Commits
742
...
5.0.2010.744
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e47f29e2e | |||
| e71c58236e | |||
| f637478dca | |||
| d3255ad00a | |||
| 75a2e18c04 | |||
| 053a9a5c93 | |||
| e7ce86abf2 | |||
| a52ae045b7 | |||
| c2ce8fb028 | |||
| ebb7fc5478 | |||
| fb5b663327 |
Vendored
+8
-4
@@ -7,10 +7,10 @@ pipeline {
|
||||
steps {
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=742']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '4.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '4.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.versionNumberBeta = VersionNumber(versionNumberString : '4.9.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
withEnv(['NEXT_BUILD_NUMBER=744']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '5.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '5.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.versionNumberBeta = VersionNumber(versionNumberString : '5.0.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'SteamWareLib'
|
||||
}
|
||||
}
|
||||
@@ -37,10 +37,12 @@ pipeline {
|
||||
script {
|
||||
parallel (
|
||||
IO: {
|
||||
sleep 3;
|
||||
// Reports lib
|
||||
bat "\"${tool 'MSBuild-15.0'}\" SteamWare.IO\\SteamWare.IO.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m"
|
||||
},
|
||||
LOGGER: {
|
||||
sleep 5;
|
||||
// Reports lib
|
||||
bat "\"${tool 'MSBuild-15.0'}\" SteamWare.Logger\\SteamWare.Logger.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m"
|
||||
},
|
||||
@@ -90,12 +92,14 @@ pipeline {
|
||||
fixNuget("${WORKSPACE}\\SteamWare.sln")
|
||||
parallel (
|
||||
IO: {
|
||||
sleep 3;
|
||||
// BUILD Logger lib!
|
||||
bat "\"${tool 'MSBuild-16.0'}\" SteamWare.IO\\SteamWare.IO.csproj -target:Build /p:Configuration=${env.config} /p:Platform=\"Any CPU\" /p:OutputPath=bin/${env.config} /m"
|
||||
// creo package NuGet... con version in modo da fare ANCHE le beta
|
||||
bat "e:\\nuget.exe pack ${WORKSPACE}\\SteamWare.IO\\SteamWare.IO.csproj -properties Configuration=${env.config} -Version ${env.packVers}"
|
||||
},
|
||||
LOGGER: {
|
||||
sleep 5;
|
||||
// BUILD Logger lib!
|
||||
bat "\"${tool 'MSBuild-16.0'}\" SteamWare.Logger\\SteamWare.Logger.csproj -target:Build /p:Configuration=${env.config} /p:Platform=\"Any CPU\" /p:OutputPath=bin/${env.config} /m"
|
||||
// creo package NuGet... con version in modo da fare ANCHE le beta
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
---------------------------------------------------------------
|
||||
------- SteamWareLib SDK -------
|
||||
---------------------------------------------------------------
|
||||
|
||||
Libreria di utility base di SteamWare.
|
||||
|
||||
Le dipendenze inserite sono necessarie al funzionamento dell'SDK.
|
||||
|
||||
Sono inclusi a titolo di esempio vari files di conf:
|
||||
* example-NLog.config
|
||||
|
||||
Attenzione a configurare correttamente il file NLog.xml includendo il rule per la classe, vedere ad esempio il file example-NLog.config allegato.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 31 KiB |
@@ -62,7 +62,7 @@
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.4\lib\net45\NLog.dll</HintPath>
|
||||
<HintPath>..\packages\NLog.4.7.5\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.1.16\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
|
||||
@@ -76,9 +76,6 @@
|
||||
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\StackExchange.Redis.2.1.58\lib\net461\StackExchange.Redis.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SteamWare.Logger, Version=4.9.2009.739, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.Logger.4.9.2009.739\lib\net462\SteamWare.Logger.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
@@ -88,6 +85,7 @@
|
||||
<Reference Include="System.Diagnostics.PerformanceCounter, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.PerformanceCounter.4.7.0\lib\net461\System.Diagnostics.PerformanceCounter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<!-- <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
</Reference> -->
|
||||
@@ -209,12 +207,16 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="App_Readme\README_SteamWare.txt" />
|
||||
<Content Include="App_Readme\SteamWare_demo\example-favicon.ico" />
|
||||
<Content Include="Core\Compression\Snappy\lib\win\snappy32.dll" />
|
||||
<Content Include="Core\Compression\Snappy\lib\win\snappy64.dll" />
|
||||
<Content Include="Core\Compression\Zstandard\lib\win\libzstd.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SteamWare.Logger\SteamWare.Logger.csproj">
|
||||
<Project>{97a9f482-c173-4f0f-9f8f-7bb41c59cdd6}</Project>
|
||||
<Name>SteamWare.Logger</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\MongoDB.Libmongocrypt.1.0.0\build\MongoDB.Libmongocrypt.targets" Condition="Exists('..\packages\MongoDB.Libmongocrypt.1.0.0\build\MongoDB.Libmongocrypt.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
||||
@@ -8,13 +8,12 @@
|
||||
<package id="MongoDB.Driver.Core" version="2.11.2" targetFramework="net462" />
|
||||
<package id="MongoDB.Libmongocrypt" version="1.0.0" targetFramework="net462" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net462" />
|
||||
<package id="NLog" version="4.7.4" targetFramework="net462" />
|
||||
<package id="NLog" version="4.7.5" targetFramework="net462" />
|
||||
<package id="Pipelines.Sockets.Unofficial" version="2.1.16" targetFramework="net462" />
|
||||
<package id="SharpCompress" version="0.26.0" targetFramework="net462" />
|
||||
<package id="SharpZipLib" version="1.2.0" targetFramework="net462" />
|
||||
<package id="Snappy.NET" version="1.1.1.8" targetFramework="net462" />
|
||||
<package id="StackExchange.Redis" version="2.1.58" targetFramework="net462" />
|
||||
<package id="SteamWare.Logger" version="4.9.2009.739" targetFramework="net462" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net462" />
|
||||
<package id="System.Diagnostics.PerformanceCounter" version="4.7.0" targetFramework="net462" />
|
||||
<package id="System.IO.Compression" version="4.3.0" targetFramework="net462" />
|
||||
|
||||
@@ -6,14 +6,19 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SteamWare.Logger
|
||||
{
|
||||
public class Constants
|
||||
{
|
||||
public enum ERROR_LEVEL
|
||||
public class Constants
|
||||
{
|
||||
INFO = 1,
|
||||
WARNING = 2,
|
||||
ERROR = 3,
|
||||
FATAL = 4
|
||||
#region Public Enums
|
||||
|
||||
public enum ERROR_LEVEL
|
||||
{
|
||||
Info = 1,
|
||||
Warning,
|
||||
Error,
|
||||
Exception,
|
||||
Fatal
|
||||
}
|
||||
|
||||
#endregion Public Enums
|
||||
}
|
||||
}
|
||||
}
|
||||
+84
-68
@@ -6,92 +6,108 @@ using static SteamWare.Logger.Constants;
|
||||
|
||||
namespace SteamWare.Logger
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe helper x LOG basata su NLog
|
||||
/// </summary>
|
||||
public static class Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// S
|
||||
/// Classe helper x LOG basata su NLog
|
||||
/// </summary>
|
||||
public static NLog.Logger Instance { get; private set; }
|
||||
|
||||
static Logging()
|
||||
public static class Logging
|
||||
{
|
||||
#if DEBUG
|
||||
// Setup the logging view for Sentinel - http://sentinel.codeplex.com
|
||||
var sentinalTarget = new NLogViewerTarget()
|
||||
{
|
||||
Name = "sentinal",
|
||||
Address = "udp://127.0.0.1:9999",
|
||||
IncludeNLogData = false
|
||||
};
|
||||
var sentinalRule = new LoggingRule("*", LogLevel.Trace, sentinalTarget);
|
||||
LogManager.Configuration.AddTarget("sentinal", sentinalTarget);
|
||||
LogManager.Configuration.LoggingRules.Add(sentinalRule);
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
static Logging()
|
||||
{
|
||||
#if false
|
||||
// Setup the logging view for Sentinel - http://sentinel.codeplex.com
|
||||
var sentinalTarget = new NLogViewerTarget()
|
||||
{
|
||||
Name = "sentinal",
|
||||
Address = "udp://127.0.0.1:9999",
|
||||
IncludeNLogData = false
|
||||
};
|
||||
var sentinalRule = new LoggingRule("*", LogLevel.Trace, sentinalTarget);
|
||||
LogManager.Configuration.AddTarget("sentinal", sentinalTarget);
|
||||
LogManager.Configuration.LoggingRules.Add(sentinalRule);
|
||||
|
||||
#endif
|
||||
|
||||
LogManager.ReconfigExistingLoggers();
|
||||
LogManager.ReconfigExistingLoggers();
|
||||
|
||||
Instance = LogManager.GetCurrentClassLogger();
|
||||
}
|
||||
Instance = LogManager.GetCurrentClassLogger();
|
||||
}
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
#endregion Public Constructors
|
||||
|
||||
public static void LogException(Exception ex, ERROR_LEVEL errorLevel)
|
||||
{
|
||||
LogMessage(ex.Message, errorLevel);
|
||||
}
|
||||
#region Public Properties
|
||||
|
||||
public static void LogMessage(string message, ERROR_LEVEL errorLevel)
|
||||
{
|
||||
switch (errorLevel)
|
||||
{
|
||||
case ERROR_LEVEL.INFO:
|
||||
{
|
||||
Log.Info(message);
|
||||
}
|
||||
break;
|
||||
/// <summary>
|
||||
/// S
|
||||
/// </summary>
|
||||
public static NLog.Logger Instance { get; private set; }
|
||||
|
||||
case ERROR_LEVEL.WARNING:
|
||||
{
|
||||
Log.Warn(message);
|
||||
}
|
||||
break;
|
||||
#endregion Public Properties
|
||||
|
||||
case ERROR_LEVEL.ERROR:
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public static void LogError(string message)
|
||||
{
|
||||
Log.Error(message);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ERROR_LEVEL.FATAL:
|
||||
{
|
||||
public static void LogException(Exception ex, ERROR_LEVEL errorLevel)
|
||||
{
|
||||
LogMessage(ex.Message, errorLevel);
|
||||
}
|
||||
|
||||
public static void LogFatal(string message)
|
||||
{
|
||||
Log.Fatal(message);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void LogInfo(string message)
|
||||
{
|
||||
Log.Info(message);
|
||||
}
|
||||
public static void LogInfo(string message)
|
||||
{
|
||||
Log.Info(message);
|
||||
}
|
||||
|
||||
public static void LogWarning(string message)
|
||||
{
|
||||
Log.Warn(message);
|
||||
}
|
||||
public static void LogMessage(string message, ERROR_LEVEL errorLevel)
|
||||
{
|
||||
switch (errorLevel)
|
||||
{
|
||||
case ERROR_LEVEL.Info:
|
||||
{
|
||||
Log.Info(message);
|
||||
}
|
||||
break;
|
||||
|
||||
public static void LogError(string message)
|
||||
{
|
||||
Log.Error(message);
|
||||
}
|
||||
case ERROR_LEVEL.Warning:
|
||||
{
|
||||
Log.Warn(message);
|
||||
}
|
||||
break;
|
||||
|
||||
public static void LogFatal(string message)
|
||||
{
|
||||
Log.Fatal(message);
|
||||
case ERROR_LEVEL.Error:
|
||||
{
|
||||
Log.Error(message);
|
||||
}
|
||||
break;
|
||||
|
||||
case ERROR_LEVEL.Fatal:
|
||||
{
|
||||
Log.Fatal(message);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void LogWarning(string message)
|
||||
{
|
||||
Log.Warn(message);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.4\lib\net45\NLog.dll</HintPath>
|
||||
<HintPath>..\packages\NLog.4.7.5\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NLog" version="4.7.4" targetFramework="net462" />
|
||||
<package id="NLog" version="4.7.5" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -1,37 +0,0 @@
|
||||
using NLog;
|
||||
using NLog.Config;
|
||||
using NLog.Targets;
|
||||
|
||||
namespace SteamWare
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe helper x LOG basata su NLog
|
||||
/// </summary>
|
||||
public static class Log
|
||||
{
|
||||
/// <summary>
|
||||
/// S
|
||||
/// </summary>
|
||||
public static Logger Instance { get; private set; }
|
||||
static Log()
|
||||
{
|
||||
#if DEBUG
|
||||
// Setup the logging view for Sentinel - http://sentinel.codeplex.com
|
||||
var sentinalTarget = new NLogViewerTarget()
|
||||
{
|
||||
Name = "sentinal",
|
||||
Address = "udp://127.0.0.1:9999",
|
||||
IncludeNLogData = false
|
||||
};
|
||||
var sentinalRule = new LoggingRule("*", LogLevel.Trace, sentinalTarget);
|
||||
LogManager.Configuration.AddTarget("sentinal", sentinalTarget);
|
||||
LogManager.Configuration.LoggingRules.Add(sentinalRule);
|
||||
|
||||
#endif
|
||||
|
||||
LogManager.ReconfigExistingLoggers();
|
||||
|
||||
Instance = LogManager.GetCurrentClassLogger();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.4\lib\net45\NLog.dll</HintPath>
|
||||
<HintPath>..\packages\NLog.4.7.5\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PdfSharp, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\PDFsharp.1.50.5147\lib\net20\PdfSharp.dll</HintPath>
|
||||
@@ -140,6 +140,7 @@
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<!-- <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
</Reference> -->
|
||||
@@ -268,7 +269,6 @@
|
||||
<Compile Include="licenseMan.cs" />
|
||||
<Compile Include="log2note.cs" />
|
||||
<Compile Include="logger.cs" />
|
||||
<Compile Include="Logging.cs" />
|
||||
<Compile Include="memLayer.cs" />
|
||||
<Compile Include="NetworkConnection.cs" />
|
||||
<Compile Include="pdfUtils.cs" />
|
||||
@@ -447,6 +447,12 @@
|
||||
<ItemGroup>
|
||||
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SteamWare.Logger\SteamWare.Logger.csproj">
|
||||
<Project>{97a9f482-c173-4f0f-9f8f-7bb41c59cdd6}</Project>
|
||||
<Name>SteamWare.Logger</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
||||
+1221
-1210
File diff suppressed because it is too large
Load Diff
+48
-3
@@ -92,6 +92,21 @@ namespace SteamWare
|
||||
/// </summary>
|
||||
protected int _logMaxMb;
|
||||
|
||||
/// <summary>
|
||||
/// max numero di veto count da accettare
|
||||
/// </summary>
|
||||
protected int _vetoRedisCheckLimit = 100;
|
||||
|
||||
/// <summary>
|
||||
/// max numero di veto count da accettare
|
||||
/// </summary>
|
||||
protected int _vetoRedisPausePurge = 20;
|
||||
|
||||
/// <summary>
|
||||
/// max numero di key da eliminare ogni check
|
||||
/// </summary>
|
||||
protected int _vetoRedisPurgeMax = 200;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se sia abilitato log diagnostico esteso...
|
||||
/// </summary>
|
||||
@@ -137,6 +152,34 @@ namespace SteamWare
|
||||
{
|
||||
enableDumpDiag = false;
|
||||
}
|
||||
// imposto i parametri per la pulizia dei veto su Redis
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(memLayer.ML.CRS("vetoRedisCheckLimit")))
|
||||
{
|
||||
_vetoRedisCheckLimit = memLayer.ML.CRI("vetoRedisCheckLimit");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(memLayer.ML.CRS("vetoRedisPausePurge")))
|
||||
{
|
||||
_vetoRedisPausePurge = memLayer.ML.CRI("vetoRedisPausePurge");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(memLayer.ML.CRS("vetoRedisPurgeMax")))
|
||||
{
|
||||
_vetoRedisPurgeMax = memLayer.ML.CRI("vetoRedisPurgeMax");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// all'avvio imposto ultimo check a 23 ore fa... così farà shrink DOPO 1 h da avvio
|
||||
lastDirCheck = DateTime.Now.AddHours(-23);
|
||||
}
|
||||
@@ -210,19 +253,21 @@ namespace SteamWare
|
||||
private void purgeOldVeto()
|
||||
{
|
||||
// limite minimo di chaivi salvate per cui procedere coi controlli
|
||||
int checkLimit = 100;
|
||||
int checkLimit = _vetoRedisCheckLimit;
|
||||
// limito cleanup x avere un operazione graduale...
|
||||
int maxCleanup = checkLimit * 2;
|
||||
int maxCleanup = _vetoRedisPurgeMax;
|
||||
// parto recuperando i valori VETO.... se > 100...
|
||||
string redKeyCounters = memLayer.ML.redHash("Logger:Counter:*");
|
||||
string redLastCheck = memLayer.ML.redHash("Logger:CheckLock");
|
||||
// se non ho un veto check...
|
||||
if (string.IsNullOrEmpty(memLayer.ML.getRSV(redLastCheck)))
|
||||
{
|
||||
memLayer.ML.setRSV(redLastCheck, "LOCK", 5);
|
||||
memLayer.ML.setRSV(redLastCheck, "LOCK", _vetoRedisPausePurge);
|
||||
int numCount = memLayer.ML.redCountKey(redKeyCounters);
|
||||
if (numCount > checkLimit)
|
||||
{
|
||||
// se necessario riduco valore maxCleanup --> checkLimit...
|
||||
maxCleanup = numCount < maxCleanup ? checkLimit : maxCleanup;
|
||||
var redKeysList2check = memLayer.ML.redGetKeys(redKeyCounters);
|
||||
foreach (var item in redKeysList2check)
|
||||
{
|
||||
|
||||
+26
-14
@@ -24,6 +24,8 @@ namespace SteamWare
|
||||
|
||||
#endregion oggetti protected utilizzati
|
||||
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// oggetto singleton x accesso al layer di memoria
|
||||
/// </summary>
|
||||
@@ -39,6 +41,10 @@ namespace SteamWare
|
||||
/// </summary>
|
||||
public DS_UtilityTableAdapters.ConfigTmpTableAdapter taConfigTmp;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Protected Constructors
|
||||
|
||||
/// <summary>
|
||||
/// classe gestione accessi a Session, cache, viewstate, configuration...
|
||||
/// </summary>
|
||||
@@ -52,16 +58,9 @@ namespace SteamWare
|
||||
setupMongo();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se si debba serializzare ogni valore complesso (tabelle/righe) in sessione (per impiego di sessioni avanzate come Redis)
|
||||
/// </summary>
|
||||
public bool serializeSession
|
||||
{
|
||||
get
|
||||
{
|
||||
return CRB("serializeSession");
|
||||
}
|
||||
}
|
||||
#endregion Protected Constructors
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// stringa conn x DB CONF
|
||||
@@ -86,6 +85,19 @@ namespace SteamWare
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se si debba serializzare ogni valore complesso (tabelle/righe) in sessione (per impiego di sessioni avanzate come Redis)
|
||||
/// </summary>
|
||||
public bool serializeSession
|
||||
{
|
||||
get
|
||||
{
|
||||
return CRB("serializeSession");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// init dei table adapters
|
||||
/// </summary>
|
||||
@@ -312,7 +324,7 @@ namespace SteamWare
|
||||
}
|
||||
}
|
||||
// log ricarica
|
||||
logger.lg.scriviLog(string.Format("Effettuata procedura ricaricaAppConf per {0} records", answ.Count), tipoLog.INFO);
|
||||
Logger.Logging.Instance.Info($"Effettuata procedura ricaricaAppConf per {answ.Count} records");
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -353,12 +365,12 @@ namespace SteamWare
|
||||
}
|
||||
// salvo in redis valori (con TTL)
|
||||
redSaveHash(ACBH, valori, maxAgeAppConf);
|
||||
logger.lg.scriviLog("Completato procedura startupAppConf ", tipoLog.INFO);
|
||||
Logger.Logging.Instance.Info("Completato procedura startupAppConf");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in startupAppConf:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
Logger.Logging.Instance.Error($"Errore in startupAppConf:{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1852,7 +1864,7 @@ namespace SteamWare
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Instance.Error(exc, $"{exc}", tipoLog.EXCEPTION);
|
||||
Logger.Logging.LogException(exc, Logger.Constants.ERROR_LEVEL.Error);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<package id="MongoDB.Libmongocrypt" version="1.0.0" targetFramework="net462" />
|
||||
<package id="NETStandard.Library" version="2.0.3" targetFramework="net462" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net462" />
|
||||
<package id="NLog" version="4.7.4" targetFramework="net462" />
|
||||
<package id="NLog" version="4.7.5" targetFramework="net462" />
|
||||
<package id="PDFsharp" version="1.50.5147" targetFramework="net462" />
|
||||
<package id="Pipelines.Sockets.Unofficial" version="2.1.16" targetFramework="net462" />
|
||||
<package id="SharpCompress" version="0.26.0" targetFramework="net462" />
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
<add key="cacheOnRedis" value="true" />
|
||||
<add key="redisDb" value="1" />
|
||||
<add key="_logDir" value="./logs/" />
|
||||
<add key="vetoRedisCheckLimit" value="100" />
|
||||
<add key="vetoRedisPausePurge" value="10" />
|
||||
<add key="vetoRedisPurgeMax" value="300" />
|
||||
<add key="codModulo" value="TestBench" />
|
||||
<add key="DbConfConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=TestBench;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
</appSettings>
|
||||
|
||||
Reference in New Issue
Block a user