Added integration tests for CacheInstructionRepository.

This commit is contained in:
Andy Butland
2021-03-07 19:35:36 +01:00
parent 6db390e1d5
commit dc21e9ee8a
4 changed files with 156 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
}
/// <inheritdoc/>
public IEnumerable<CacheInstruction> GetInstructions(int lastId, int maxNumberToRetrieve)
public IEnumerable<CacheInstruction> GetPendingInstructions(int lastId, int maxNumberToRetrieve)
{
Sql<ISqlContext> sql = AmbientScope.SqlContext.Sql().SelectAll()
.From<CacheInstructionDto>()

View File

@@ -248,7 +248,7 @@ namespace Umbraco.Cms.Core.Services.Implement
// some memory however we cannot do that because inside of this loop the cache refreshers are also
// performing some lookups which cannot be done with an active reader open.
lastId = 0;
foreach (CacheInstruction instruction in _cacheInstructionRepository.GetInstructions(lastId, MaxInstructionsToRetrieve))
foreach (CacheInstruction instruction in _cacheInstructionRepository.GetPendingInstructions(lastId, MaxInstructionsToRetrieve))
{
// If this flag gets set it means we're shutting down! In this case, we need to exit asap and cannot
// continue processing anything otherwise we'll hold up the app domain shutdown.