Fix buf in Healthchecksettings

This commit is contained in:
Bjarke Berg
2020-03-16 19:00:18 +01:00
parent 877339e7db
commit 449d534701
2 changed files with 11 additions and 3 deletions

View File

@@ -48,8 +48,13 @@ namespace Umbraco.Configuration.Models
.GetChildren()
.ToDictionary(x=>x.Key, x=> (INotificationMethod) new NotificationMethod(x.Key, x));
public IEnumerable<IDisabledHealthCheck> DisabledChecks =>
_configurationSection.GetValue<DisabledHealthCheck[]>("DisabledChecks", Array.Empty<DisabledHealthCheck>());
public IEnumerable<IDisabledHealthCheck> DisabledChecks => _configurationSection.GetSection("DisabledChecks").GetChildren().Select(
x => new DisabledHealthCheck()
{
Id = x.GetValue<Guid>("Id"),
DisabledOn = x.GetValue<DateTime>("DisabledOn"),
DisabledBy = x.GetValue<int>("DisabledBy"),
});
}
private class NotificationMethod : INotificationMethod

View File

@@ -7,6 +7,7 @@ using Umbraco.Composing;
using Umbraco.Configuration;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.HealthChecks;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Logging.Serilog;
@@ -29,7 +30,9 @@ namespace Umbraco.Web.BackOffice.AspNetCore
var configsFactory = new AspNetCoreConfigsFactory(configuration);
var configs = configsFactory.Create();
var settings = configs.GetConfig<IModelsBuilderConfig>();
var settings = configs.GetConfig<IHealthChecksSettings>();
services.CreateCompositionRoot(
httpContextAccessor,