Files
Umbraco-CMS/src/Umbraco.Web/PublishedCache/NuCache/NuCacheComponent.cs
2018-07-20 16:39:39 +02:00

33 lines
1.2 KiB
C#

using Umbraco.Core.Components;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.PublishedCache.NuCache.DataSource;
namespace Umbraco.Web.PublishedCache.NuCache
{
public class NuCacheComponent : UmbracoComponentBase, IUmbracoCoreComponent
{
public override void Compose(Composition composition)
{
base.Compose(composition);
// register the NuCache database data source
composition.Container.Register<IDataSource, DatabaseDataSource>();
// 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
}
}
}