Creates data integrity health checks

This commit is contained in:
Shannon
2020-04-07 01:02:08 +10:00
parent 50e9f79ae6
commit 4b467bf470
8 changed files with 326 additions and 3 deletions

View File

@@ -2375,6 +2375,26 @@ namespace Umbraco.Core.Services.Implement
return OperationResult.Succeed(evtMsgs);
}
public bool VerifyNodePaths(out int[] invalidIds)
{
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
{
scope.ReadLock(Constants.Locks.ContentTree);
return _documentRepository.VerifyNodePaths(out invalidIds);
}
}
public void FixNodePaths()
{
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
{
scope.WriteLock(Constants.Locks.ContentTree);
_documentRepository.FixNodePaths();
// TODO: We're going to have to clear all caches
}
}
#endregion
#region Internal Methods