- disabled the duplicated community health checks (#4175)

This commit is contained in:
Paul Seal
2019-01-26 14:01:03 +00:00
committed by Sebastiaan Janssen
parent 7acafe67a4
commit c9819b2d89
4 changed files with 31 additions and 18 deletions

View File

@@ -8,19 +8,19 @@ For details on the format of this configuration file see:
https://our.umbraco.com/documentation/reference/config/healthchecks
-->
<HealthChecks>
<disabledChecks>
<!--<check id="1B5D221B-CE99-4193-97CB-5F3261EC73DF" disabledOn="" disabledBy="0" />-->
</disabledChecks>
<notificationSettings enabled="true" firstRunTime="" periodInHours="24">
<notificationMethods>
<notificationMethod alias="email" enabled="true" verbosity="Summary">
<settings>
<add key="recipientEmail" value="" />
</settings>
</notificationMethod>
</notificationMethods>
<disabledChecks>
<!--<check id="EB66BB3B-1BCD-4314-9531-9DA2C1D6D9A7" disabledOn="" disabledBy="0" />-->
</disabledChecks>
</notificationSettings>
</HealthChecks>
<!--<check id="1B5D221B-CE99-4193-97CB-5F3261EC73DF" disabledOn="" disabledBy="0" />-->
</disabledChecks>
<notificationSettings enabled="true" firstRunTime="" periodInHours="24">
<notificationMethods>
<notificationMethod alias="email" enabled="true" verbosity="Summary">
<settings>
<add key="recipientEmail" value="" />
</settings>
</notificationMethod>
</notificationMethods>
<disabledChecks>
<!--<check id="EB66BB3B-1BCD-4314-9531-9DA2C1D6D9A7" disabledOn="" disabledBy="0" />-->
</disabledChecks>
</notificationSettings>
</HealthChecks>

View File

@@ -82,7 +82,7 @@ namespace Umbraco.Web.HealthCheck
public object GetStatus(Guid id)
{
var check = GetCheckById(id);
try
{
//Core.Logging.LogHelper.Debug<HealthCheckController>("Running health check: " + check.Name);
@@ -113,4 +113,4 @@ namespace Umbraco.Web.HealthCheck
return check;
}
}
}
}

View File

@@ -16,7 +16,7 @@ namespace Umbraco.Web.Scheduling
private readonly ApplicationContext _appContext;
private readonly IHealthCheckResolver _healthCheckResolver;
public HealthCheckNotifier(IBackgroundTaskRunner<RecurringTaskBase> runner, int delayMilliseconds, int periodMilliseconds,
public HealthCheckNotifier(IBackgroundTaskRunner<RecurringTaskBase> runner, int delayMilliseconds, int periodMilliseconds,
ApplicationContext appContext)
: base(runner, delayMilliseconds, periodMilliseconds)
{

View File

@@ -544,6 +544,19 @@ namespace Umbraco.Web
() => PluginManager.ResolveTypes<HealthCheck.HealthCheck>());
HealthCheckNotificationMethodResolver.Current = new HealthCheckNotificationMethodResolver(LoggerResolver.Current.Logger,
() => PluginManager.ResolveTypes<HealthCheck.NotificationMethods.IHealthCheckNotificatationMethod>());
// Disable duplicate community health checks which appear in Our.Umbraco.HealtchChecks and Umbraco Core.
// See this issue to understand why https://github.com/umbraco/Umbraco-CMS/issues/4174
var disabledHealthCheckTypes = new[]
{
"Our.Umbraco.HealthChecks.Checks.Security.HstsCheck",
"Our.Umbraco.HealthChecks.Checks.Security.TlsCheck"
}.Select(TypeFinder.GetTypeByName).WhereNotNull();
foreach (var type in disabledHealthCheckTypes)
{
HealthCheckResolver.Current.RemoveType(type);
}
}
/// <summary>