Renamed interface to prepare for adding GetPagedRollbackVersions
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Umbraco.Core.Composing.CompositionExtensions
|
||||
|
||||
composition.RegisterUnique<ContentService>();
|
||||
composition.RegisterUnique<IContentService>(factory => factory.GetInstance<ContentService>());
|
||||
composition.RegisterUnique<IContentVersionCleanupService>(factory => factory.GetInstance<ContentService>());
|
||||
composition.RegisterUnique<IContentVersionService>(factory => factory.GetInstance<ContentService>());
|
||||
composition.RegisterUnique<IContentVersionCleanupPolicy, DefaultContentVersionCleanupPolicy>();
|
||||
|
||||
composition.RegisterUnique<IUserService, UserService>();
|
||||
|
||||
@@ -4,7 +4,7 @@ using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core.Services
|
||||
{
|
||||
public interface IContentVersionCleanupService
|
||||
public interface IContentVersionService
|
||||
{
|
||||
/// <summary>
|
||||
/// Removes historic content versions according to a policy.
|
||||
@@ -19,7 +19,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <summary>
|
||||
/// Implements the content service.
|
||||
/// </summary>
|
||||
public class ContentService : RepositoryService, IContentService, IContentVersionCleanupService
|
||||
public class ContentService : RepositoryService, IContentService, IContentVersionService
|
||||
{
|
||||
private readonly IDocumentRepository _documentRepository;
|
||||
private readonly IEntityRepository _entityRepository;
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
<Compile Include="PropertyEditors\EyeDropperColorPickerConfiguration.cs" />
|
||||
<Compile Include="PropertyEditors\ComplexPropertyEditorContentEventHandler.cs" />
|
||||
<Compile Include="Services\IContentVersionCleanupPolicy.cs" />
|
||||
<Compile Include="Services\IContentVersionCleanupService.cs" />
|
||||
<Compile Include="Services\IContentVersionService.cs" />
|
||||
<Compile Include="Services\IIconService.cs" />
|
||||
<Compile Include="Services\Implement\DefaultContentVersionCleanupPolicy.cs" />
|
||||
<Compile Include="Services\Implement\InstallationService.cs" />
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Umbraco.Tests.Scheduling
|
||||
public void ContentVersionCleanup_WhenNotEnabled_DoesNotCleanupWillRepeat(
|
||||
[Frozen] Mock<IContentVersionCleanupPolicyGlobalSettings> settings,
|
||||
[Frozen] Mock<IRuntimeState> state,
|
||||
[Frozen] Mock<IContentVersionCleanupService> cleanupService,
|
||||
[Frozen] Mock<IContentVersionService> cleanupService,
|
||||
ContentVersionCleanup sut)
|
||||
{
|
||||
settings.Setup(x => x.EnableCleanup).Returns(false);
|
||||
@@ -40,7 +40,7 @@ namespace Umbraco.Tests.Scheduling
|
||||
public void ContentVersionCleanup_RuntimeLevelNotRun_DoesNotCleanupWillRepeat(
|
||||
[Frozen] Mock<IContentVersionCleanupPolicyGlobalSettings> settings,
|
||||
[Frozen] Mock<IRuntimeState> state,
|
||||
[Frozen] Mock<IContentVersionCleanupService> cleanupService,
|
||||
[Frozen] Mock<IContentVersionService> cleanupService,
|
||||
ContentVersionCleanup sut)
|
||||
{
|
||||
settings.Setup(x => x.EnableCleanup).Returns(true);
|
||||
@@ -62,7 +62,7 @@ namespace Umbraco.Tests.Scheduling
|
||||
public void ContentVersionCleanup_ServerRoleUnknown_DoesNotCleanupWillRepeat(
|
||||
[Frozen] Mock<IContentVersionCleanupPolicyGlobalSettings> settings,
|
||||
[Frozen] Mock<IRuntimeState> state,
|
||||
[Frozen] Mock<IContentVersionCleanupService> cleanupService,
|
||||
[Frozen] Mock<IContentVersionService> cleanupService,
|
||||
ContentVersionCleanup sut)
|
||||
{
|
||||
settings.Setup(x => x.EnableCleanup).Returns(true);
|
||||
@@ -84,7 +84,7 @@ namespace Umbraco.Tests.Scheduling
|
||||
public void ContentVersionCleanup_NotMainDom_DoesNotCleanupWillNotRepeat(
|
||||
[Frozen] Mock<IContentVersionCleanupPolicyGlobalSettings> settings,
|
||||
[Frozen] Mock<IRuntimeState> state,
|
||||
[Frozen] Mock<IContentVersionCleanupService> cleanupService,
|
||||
[Frozen] Mock<IContentVersionService> cleanupService,
|
||||
ContentVersionCleanup sut)
|
||||
{
|
||||
settings.Setup(x => x.EnableCleanup).Returns(true);
|
||||
@@ -106,7 +106,7 @@ namespace Umbraco.Tests.Scheduling
|
||||
public void ContentVersionCleanup_Enabled_DelegatesToCleanupService(
|
||||
[Frozen] Mock<IContentVersionCleanupPolicyGlobalSettings> settings,
|
||||
[Frozen] Mock<IRuntimeState> state,
|
||||
[Frozen] Mock<IContentVersionCleanupService> cleanupService,
|
||||
[Frozen] Mock<IContentVersionService> cleanupService,
|
||||
ContentVersionCleanup sut)
|
||||
{
|
||||
settings.Setup(x => x.EnableCleanup).Returns(true);
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Umbraco.Tests.Services
|
||||
// Kill all historic
|
||||
InsertCleanupPolicy(contentTypeA, 0, 0);
|
||||
|
||||
((IContentVersionCleanupService)ServiceContext.ContentService).PerformContentVersionCleanup(DateTime.Now.AddHours(1));
|
||||
((IContentVersionService)ServiceContext.ContentService).PerformContentVersionCleanup(DateTime.Now.AddHours(1));
|
||||
|
||||
var after = GetReport();
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Umbraco.Web.Scheduling
|
||||
private readonly IRuntimeState _runtimeState;
|
||||
private readonly IProfilingLogger _logger;
|
||||
private readonly IContentVersionCleanupPolicyGlobalSettings _settings;
|
||||
private readonly IContentVersionCleanupService _cleanupService;
|
||||
private readonly IContentVersionService _service;
|
||||
|
||||
public ContentVersionCleanup(
|
||||
IBackgroundTaskRunner<RecurringTaskBase> runner,
|
||||
@@ -21,13 +21,13 @@ namespace Umbraco.Web.Scheduling
|
||||
IRuntimeState runtimeState,
|
||||
IProfilingLogger logger,
|
||||
IContentVersionCleanupPolicyGlobalSettings settings,
|
||||
IContentVersionCleanupService cleanupService)
|
||||
IContentVersionService service)
|
||||
: base(runner, delayMilliseconds, periodMilliseconds)
|
||||
{
|
||||
_runtimeState = runtimeState ?? throw new ArgumentNullException(nameof(runtimeState));
|
||||
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
_settings = settings ?? throw new ArgumentNullException(nameof(settings));
|
||||
_cleanupService = cleanupService ?? throw new ArgumentNullException(nameof(cleanupService));
|
||||
_service = service ?? throw new ArgumentNullException(nameof(service));
|
||||
}
|
||||
|
||||
public override bool PerformRun()
|
||||
@@ -65,7 +65,7 @@ namespace Umbraco.Web.Scheduling
|
||||
return false; // do NOT repeat, going down
|
||||
}
|
||||
|
||||
var count = _cleanupService.PerformContentVersionCleanup(DateTime.Now).Count;
|
||||
var count = _service.PerformContentVersionCleanup(DateTime.Now).Count;
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Umbraco.Web.Scheduling
|
||||
|
||||
private readonly IRuntimeState _runtime;
|
||||
private readonly IContentService _contentService;
|
||||
private readonly IContentVersionCleanupService _cleanupService;
|
||||
private readonly IContentVersionService _service;
|
||||
private readonly IAuditService _auditService;
|
||||
private readonly IProfilingLogger _logger;
|
||||
private readonly IScopeProvider _scopeProvider;
|
||||
@@ -48,7 +48,7 @@ namespace Umbraco.Web.Scheduling
|
||||
public SchedulerComponent(
|
||||
IRuntimeState runtime,
|
||||
IContentService contentService,
|
||||
IContentVersionCleanupService cleanupService,
|
||||
IContentVersionService service,
|
||||
IAuditService auditService,
|
||||
HealthCheckCollection healthChecks,
|
||||
HealthCheckNotificationMethodCollection notifications,
|
||||
@@ -58,7 +58,7 @@ namespace Umbraco.Web.Scheduling
|
||||
{
|
||||
_runtime = runtime;
|
||||
_contentService = contentService;
|
||||
_cleanupService = cleanupService;
|
||||
_service = service;
|
||||
_auditService = auditService;
|
||||
_scopeProvider = scopeProvider;
|
||||
_logger = logger;
|
||||
@@ -203,7 +203,7 @@ namespace Umbraco.Web.Scheduling
|
||||
_runtime,
|
||||
_logger,
|
||||
settings.Content.ContentVersionCleanupPolicyGlobalSettings,
|
||||
_cleanupService);
|
||||
_service);
|
||||
|
||||
_contentVersionCleanupRunner.TryAdd(task);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user