diff --git a/MP.RIOC/MP.RIOC.csproj b/MP.RIOC/MP.RIOC.csproj
index 12a3a6a1..2b28390d 100644
--- a/MP.RIOC/MP.RIOC.csproj
+++ b/MP.RIOC/MP.RIOC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.RIOC
- 8.16.2606.1216
+ 8.16.2606.1217
InProcess
diff --git a/MP.RIOC/Program.cs b/MP.RIOC/Program.cs
index f2fd466a..b122a104 100644
--- a/MP.RIOC/Program.cs
+++ b/MP.RIOC/Program.cs
@@ -12,8 +12,17 @@ using System.Reflection;
var builder = WebApplication.CreateBuilder(args);
-// recupero env corrente
+// RECUPERO L'AMBIENTE REALE (Che ora IIS passa correttamente come 'Staging')
var env = builder.Environment;
+
+// FORZA IL CARICAMENTO CORRETTO DEI JSON CON LA GERARCHIA DI AMBIENTE
+builder.Configuration
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true)
+ .AddEnvironmentVariables();
+
+// recupero env corrente
var logger = LogManager.Setup()
.LoadConfigurationFromAppSettings()
.GetCurrentClassLogger();
@@ -60,23 +69,35 @@ builder.Services.AddDbContextFactory(options =>
builder.Services.AddIocDataLayer();
// 1. Configurazione dell'invoker personalizzato (Risolve i tuoi errori)
+// 1. Configurazione dell'invoker personalizzato (Potenziato con il Pooling)
var httpClientInvoker = new HttpMessageInvoker(new SocketsHttpHandler
{
UseProxy = false,
AllowAutoRedirect = false,
AutomaticDecompression = DecompressionMethods.None,
UseCookies = false,
- // Correzione per il tracing: usa il propagatore corrente di sistema
ActivityHeadersPropagator = DistributedContextPropagator.Current,
ConnectTimeout = TimeSpan.FromSeconds(60),
- // Gestione certificato (ignora errori per localhost/test)
+ // ==================================================================
+ // 🚀 LE TRE RIGHE PER ABBATTERE IL MURO DEI 2 SECONDI SOTTO STRESS
+ // ==================================================================
+ // Permette a YARP di aprire fino a 5000 canali paralleli contemporanei verso IIS
+ MaxConnectionsPerServer = 5000,
+
+ // Tiene caldi i socket ed evita di rifare l'handshake TCP/TLS a ogni richiesta
+ PooledConnectionLifetime = TimeSpan.FromMinutes(15),
+ PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2),
+ // ==================================================================
+
+ // Gestione certificato (Invariata)
SslOptions = new System.Net.Security.SslClientAuthenticationOptions
{
RemoteCertificateValidationCallback = (sender, cert, chain, sslPolicyErrors) => true
}
});
+// Registrazione nella Dependency Injection (Invariata)
builder.Services.AddSingleton(httpClientInvoker);
builder.Services.AddHttpForwarder();
diff --git a/MP.RIOC/Resources/ChangeLog.html b/MP.RIOC/Resources/ChangeLog.html
index b0206033..aa4396fe 100644
--- a/MP.RIOC/Resources/ChangeLog.html
+++ b/MP.RIOC/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MP-RIOC
- Versione: 8.16.2606.1216
+ Versione: 8.16.2606.1217
Note di rilascio:
-
diff --git a/MP.RIOC/Resources/VersNum.txt b/MP.RIOC/Resources/VersNum.txt
index 90643774..d947c970 100644
--- a/MP.RIOC/Resources/VersNum.txt
+++ b/MP.RIOC/Resources/VersNum.txt
@@ -1 +1 @@
-8.16.2606.1216
+8.16.2606.1217
diff --git a/MP.RIOC/Resources/manifest.xml b/MP.RIOC/Resources/manifest.xml
index 53089d5c..9512a461 100644
--- a/MP.RIOC/Resources/manifest.xml
+++ b/MP.RIOC/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 8.16.2606.1216
+ 8.16.2606.1217
https://nexus.steamware.net/repository/SWS/MP-RIOC/stable/LAST/MP.RIOC.zip
https://nexus.steamware.net/repository/SWS/MP-RIOC/stable/LAST/ChangeLog.html
false
diff --git a/MP.RIOC/appsettings.Staging-silent.json b/MP.RIOC/appsettings.Staging-silent.json
index 4bb192f6..b68fbaa1 100644
--- a/MP.RIOC/appsettings.Staging-silent.json
+++ b/MP.RIOC/appsettings.Staging-silent.json
@@ -20,6 +20,11 @@
"maxLevel": "Fatal",
"final": true
},
+ {
+ "logger": "*",
+ "minLevel": "Info",
+ "writeTo": "logconsole"
+ },
{
"logger": "*",
"minLevel": "Info",
diff --git a/MP.RIOC/appsettings.Staging.json b/MP.RIOC/appsettings.Staging.json
index 4bb192f6..b68fbaa1 100644
--- a/MP.RIOC/appsettings.Staging.json
+++ b/MP.RIOC/appsettings.Staging.json
@@ -20,6 +20,11 @@
"maxLevel": "Fatal",
"final": true
},
+ {
+ "logger": "*",
+ "minLevel": "Info",
+ "writeTo": "logconsole"
+ },
{
"logger": "*",
"minLevel": "Info",