Update x stato healthy con ping a db con instance
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>WebDoorCreator - Egalware</i>
|
||||
<h4>Version: 0.9.2404.2315</h4>
|
||||
<h4>Version: 0.9.2404.2316</h4>
|
||||
<br /> Release note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.9.2404.2315
|
||||
0.9.2404.2316
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>0.9.2404.2315</version>
|
||||
<version>0.9.2404.2316</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -23,7 +23,7 @@ using WebDoorCreator.UI.Areas.Identity;
|
||||
using WebDoorCreator.UI.Data;
|
||||
using static Org.BouncyCastle.Math.EC.ECCurve;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
// configuration setup
|
||||
Microsoft.Extensions.Configuration.ConfigurationManager configuration = builder.Configuration;
|
||||
|
||||
@@ -37,17 +37,24 @@ string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"))
|
||||
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
|
||||
|
||||
string dbServerAddr = "127.0.0.1";
|
||||
if(connectionString.Contains("Server"))
|
||||
if (connectionString.Contains("Server"))
|
||||
{
|
||||
var dbTokens = connectionString.Split(";");
|
||||
bool trovato = false;
|
||||
var dbTokens = connectionString.Split(";");
|
||||
int numTok = dbTokens.Count();
|
||||
int idx = 0;
|
||||
while(!trovato && idx< numTok)
|
||||
while (!trovato && idx < numTok)
|
||||
{
|
||||
if (dbTokens[idx].StartsWith("Server="))
|
||||
{
|
||||
// rimuovo la chaive Server...
|
||||
dbServerAddr = dbTokens[idx].Replace("Server=", "");
|
||||
// se ci fosse un nome (tipo \\sqlexpress) rimuovo...
|
||||
if (dbServerAddr.Contains("\\"))
|
||||
{
|
||||
int sIdx = dbServerAddr.IndexOf("\\");
|
||||
dbServerAddr = dbServerAddr.Substring(0, sIdx);
|
||||
}
|
||||
trovato = true;
|
||||
}
|
||||
idx++;
|
||||
@@ -55,7 +62,7 @@ if(connectionString.Contains("Server"))
|
||||
}
|
||||
// healthchecks
|
||||
builder.Services.AddHealthChecks()
|
||||
//.AddSqlServer(connectionString, "MsSql instance")
|
||||
.AddSqlServer(connectionString, healthQuery: "SELECT 1;", name: "sql", failureStatus: HealthStatus.Degraded, tags: new string[] { "DB", "MsSql" })
|
||||
.AddAsyncCheck($"DB PING ({dbServerAddr})", () => WebDoorCreator.UI.Health.Checks.PingCheck(dbServerAddr))
|
||||
.AddAsyncCheck($"Redis PING ({redisSrvAddr})", () => WebDoorCreator.UI.Health.Checks.PingCheck(redisSrvAddr))
|
||||
//.AddProcessAllocatedMemoryHealthCheck(512, "Max Process memory (<512MB)", failureStatus: HealthStatus.Degraded) // 512 MB max allocated memory
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.9.2404.2315</Version>
|
||||
<Version>0.9.2404.2316</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user