Converted to IOptions over IOptionsSnapshot due to the latter only working in scoped services.

Further amends to return to booting application.
This commit is contained in:
Andy Butland
2020-08-23 23:36:48 +02:00
parent 2f22313ceb
commit 2cd91a5a54
108 changed files with 230 additions and 146 deletions

View File

@@ -31,7 +31,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
// it's too late for UmbracoContext which has captured previewDefault and stuff into these ctor vars
// but, no, UmbracoContext returns snapshot.Content which comes from elements SO a resync should create a new cache
public ContentCache(bool previewDefault, ContentStore.Snapshot snapshot, IAppCache snapshotCache, IAppCache elementsCache, IDomainCache domainCache, IOptionsSnapshot<GlobalSettings> globalSettings, IVariationContextAccessor variationContextAccessor)
public ContentCache(bool previewDefault, ContentStore.Snapshot snapshot, IAppCache snapshotCache, IAppCache elementsCache, IDomainCache domainCache, IOptions<GlobalSettings> globalSettings, IVariationContextAccessor variationContextAccessor)
: this(previewDefault, snapshot, snapshotCache, elementsCache, domainCache, globalSettings.Value, variationContextAccessor)
{
}

View File

@@ -87,14 +87,14 @@ namespace Umbraco.Web.PublishedCache.NuCache
IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository,
IDefaultCultureAccessor defaultCultureAccessor,
IDataSource dataSource,
IOptionsSnapshot<GlobalSettings> globalSettings,
IOptions<GlobalSettings> globalSettings,
IEntityXmlSerializer entitySerializer,
IPublishedModelFactory publishedModelFactory,
UrlSegmentProviderCollection urlSegmentProviders,
IHostingEnvironment hostingEnvironment,
IShortStringHelper shortStringHelper,
IIOHelper ioHelper,
IOptionsSnapshot<NuCacheSettings> config)
IOptions<NuCacheSettings> config)
: base(publishedSnapshotAccessor, variationContextAccessor)
{
//if (Interlocked.Increment(ref _singletonCheck) > 1)