Skip to content

Commit 4be183a

Browse files
authored
Do not rely on NuCache to do key/id lookups (#17291)
* Fixes #17182 * Ensure wait-on is installed
1 parent 378d4ec commit 4be183a

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

build/azure-pipelines.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ stages:
506506
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
507507
workingDirectory: $(Agent.BuildDirectory)/app
508508
509+
# Ensures we have the package wait-on installed
510+
- pwsh: npm install wait-on
511+
displayName: Install wait-on package
512+
509513
# Wait for application to start responding to requests
510514
- pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
511515
displayName: Wait for application

src/Umbraco.PublishedCache.NuCache/DependencyInjection/UmbracoBuilderExtensions.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,7 @@ public static IUmbracoBuilder AddNuCache(this IUmbracoBuilder builder)
3737
builder.Services.TryAddSingleton<IPublishedSnapshotStatus, PublishedSnapshotStatus>();
3838
builder.Services.TryAddTransient<IReservedFieldNamesService, ReservedFieldNamesService>();
3939

40-
// replace this service since we want to improve the content/media
41-
// mapping lookups if we are using nucache.
42-
// TODO: Gotta wonder how much this does actually improve perf? It's a lot of weird code to make this happen so hope it's worth it
43-
builder.Services.AddUnique<IIdKeyMap>(factory =>
44-
{
45-
var idkSvc = new IdKeyMap(
46-
factory.GetRequiredService<ICoreScopeProvider>(),
47-
factory.GetRequiredService<IIdKeyMapRepository>());
48-
if (factory.GetRequiredService<IPublishedSnapshotService>() is PublishedSnapshotService
49-
publishedSnapshotService)
50-
{
51-
idkSvc.SetMapper(UmbracoObjectTypes.Document, id => publishedSnapshotService.GetDocumentUid(id), uid => publishedSnapshotService.GetDocumentId(uid));
52-
idkSvc.SetMapper(UmbracoObjectTypes.Media, id => publishedSnapshotService.GetMediaUid(id), uid => publishedSnapshotService.GetMediaId(uid));
53-
}
54-
55-
return idkSvc;
56-
});
40+
builder.Services.AddUnique<IIdKeyMap, IdKeyMap>();
5741

5842
builder.AddNuCacheNotifications();
5943

0 commit comments

Comments
 (0)