Resvolution - WIP running without Resolution
This commit is contained in:
@@ -14,7 +14,6 @@ using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.ObjectResolution;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
using Umbraco.Core.Persistence.Repositories;
|
||||
@@ -141,13 +140,10 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
|
||||
_domainStore = new SnapDictionary<int, Domain>();
|
||||
|
||||
if (Resolution.IsFrozen)
|
||||
OnResolutionFrozen();
|
||||
else
|
||||
Resolution.Frozen += (sender, args) => OnResolutionFrozen();
|
||||
LoadCaches();
|
||||
}
|
||||
|
||||
private void OnResolutionFrozen()
|
||||
private void LoadCaches()
|
||||
{
|
||||
lock (_storesLock)
|
||||
{
|
||||
|
||||
32
src/Umbraco.Web/PublishedCache/NuCache/NuCacheComponent.cs
Normal file
32
src/Umbraco.Web/PublishedCache/NuCache/NuCacheComponent.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using LightInject;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Components;
|
||||
using Umbraco.Core.DependencyInjection;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Web.PublishedCache.NuCache
|
||||
{
|
||||
public class NuCacheComponent : UmbracoComponentBase, IUmbracoCoreComponent
|
||||
{
|
||||
public override void Compose(ServiceContainer container)
|
||||
{
|
||||
base.Compose(container);
|
||||
|
||||
// register the NuCache facade service
|
||||
container.RegisterSingleton<IFacadeService>(factory => new FacadeService(
|
||||
new FacadeService.Options { FacadeCacheIsApplicationRequestCache = true },
|
||||
factory.GetInstance<ApplicationContext>().MainDom,
|
||||
factory.GetInstance<ServiceContext>(),
|
||||
factory.GetInstance<IDatabaseUnitOfWorkProvider>(),
|
||||
factory.GetInstance<IFacadeAccessor>(),
|
||||
factory.GetInstance<ILogger>()));
|
||||
}
|
||||
|
||||
public void Initialize(IFacadeService service)
|
||||
{
|
||||
// nothing - this just ensures that the service is created at boot time
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user