Fix heathcheck ping:
- esclusi indirizzi non validi linux - review startup
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Version>1.0.2407.2414</Version>
|
||||
<Version>1.0.2407.2415</Version>
|
||||
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
|
||||
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
|
||||
|
||||
+18
-11
@@ -110,20 +110,27 @@ namespace GWMS.UI.Health
|
||||
|
||||
public static async Task<HealthCheckResult> PingCheck(string hostName)
|
||||
{
|
||||
using (var thePing = new Ping())
|
||||
if (hostName.Contains("::") || hostName.Contains("0.0.0.0"))
|
||||
{
|
||||
var pingResult = await thePing.SendPingAsync(hostName);
|
||||
var description = $"Ping to {hostName}";
|
||||
var healthCheckData = new Dictionary<string, object>();
|
||||
healthCheckData.Add("RoundTripMS", pingResult.RoundtripTime);
|
||||
healthCheckData.Add("ActualIPAddress", pingResult.Address.ToString());
|
||||
if (pingResult.Status == IPStatus.Success)
|
||||
return HealthCheckResult.Unhealthy($"Wrong Hostname: {hostName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var thePing = new Ping())
|
||||
{
|
||||
description += $" - {pingResult.RoundtripTime}ms";
|
||||
return HealthCheckResult.Healthy(description, healthCheckData);
|
||||
}
|
||||
var pingResult = await thePing.SendPingAsync(hostName);
|
||||
var description = $"Ping to {hostName}";
|
||||
var healthCheckData = new Dictionary<string, object>();
|
||||
healthCheckData.Add("RoundTripMS", pingResult.RoundtripTime);
|
||||
healthCheckData.Add("ActualIPAddress", pingResult.Address.ToString());
|
||||
if (pingResult.Status == IPStatus.Success)
|
||||
{
|
||||
description += $" - {pingResult.RoundtripTime}ms";
|
||||
return HealthCheckResult.Healthy(description, healthCheckData);
|
||||
}
|
||||
|
||||
return HealthCheckResult.Unhealthy(description + $" {hostName}", null, healthCheckData);
|
||||
return HealthCheckResult.Unhealthy(description + $" {hostName}", null, healthCheckData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ namespace GWMS.UI
|
||||
// altri parametri per check vari
|
||||
string connStringDB = DbConfig.CONNECTION_STRING;
|
||||
string connStringRedis = Configuration.GetConnectionString("Redis");
|
||||
string redisSrvAddr = "localhost";
|
||||
string redisSrvAddr = "127.0.0.1";
|
||||
if (connStringRedis.Contains(":"))
|
||||
{
|
||||
redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>GWMS - Gas Warehouse Management System</i>
|
||||
<h4>Versione: 1.0.2407.2414</h4>
|
||||
<h4>Versione: 1.0.2407.2415</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0.2407.2414
|
||||
1.0.2407.2415
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.0.2407.2414</version>
|
||||
<version>1.0.2407.2415</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user