Fixes issue with the delivery api can find unpublished content
This commit is contained in:
Bjarke Berg
2024-11-04 12:27:47 +01:00
committed by GitHub
parent e4d99747d1
commit 6417948a58
5 changed files with 37 additions and 12 deletions

View File

@@ -270,11 +270,17 @@ internal sealed class DocumentCacheService : IDocumentCacheService
await _databaseCacheRepository.RefreshContentAsync(draftCacheNode, content.PublishedState);
if (content.PublishedState == PublishedState.Publishing)
if (content.PublishedState == PublishedState.Publishing || content.PublishedState == PublishedState.Unpublishing)
{
var publishedCacheNode = _cacheNodeFactory.ToContentCacheNode(content, false);
await _databaseCacheRepository.RefreshContentAsync(publishedCacheNode, content.PublishedState);
if (content.PublishedState == PublishedState.Unpublishing)
{
await _hybridCache.RemoveAsync(GetCacheKey(publishedCacheNode.Key, false));
}
}
scope.Complete();