Files
Umbraco-CMS/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComponent.cs
2018-03-30 14:00:44 +02:00

34 lines
1.2 KiB
C#

using Umbraco.Core;
using Umbraco.Core.Components;
using Umbraco.Core.Logging;
using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using LightInject;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Persistence.Repositories;
namespace Umbraco.Web.PublishedCache.NuCache
{
public class NuCacheComponent : UmbracoComponentBase, IUmbracoCoreComponent
{
public override void Compose(Composition composition)
{
base.Compose(composition);
// register the NuCache published snapshot service
// must register default options, required in the service ctor
composition.Container.Register(factory => new PublishedSnapshotService.Options());
composition.SetPublishedSnapshotService<PublishedSnapshotService>();
// add the NuCache health check (hidden from type finder)
// todo - no NuCache health check yet
//composition.HealthChecks().Add<NuCacheIntegrityHealthCheck>();
}
public void Initialize(IPublishedSnapshotService service)
{
// nothing - this just ensures that the service is created at boot time
}
}
}