Introduce IUmbracoContextFactory
This commit is contained in:
@@ -24,6 +24,7 @@ namespace Umbraco.Web.Scheduling
|
||||
private readonly IScopeProvider _scopeProvider;
|
||||
private readonly HealthCheckCollection _healthChecks;
|
||||
private readonly HealthCheckNotificationMethodCollection _notifications;
|
||||
private readonly IUmbracoContextFactory _umbracoContextFactory;
|
||||
|
||||
private BackgroundTaskRunner<IBackgroundTask> _keepAliveRunner;
|
||||
private BackgroundTaskRunner<IBackgroundTask> _publishingRunner;
|
||||
@@ -38,13 +39,14 @@ namespace Umbraco.Web.Scheduling
|
||||
public SchedulerComponent(IRuntimeState runtime,
|
||||
IContentService contentService, IAuditService auditService,
|
||||
HealthCheckCollection healthChecks, HealthCheckNotificationMethodCollection notifications,
|
||||
IScopeProvider scopeProvider, IProfilingLogger logger)
|
||||
IScopeProvider scopeProvider, IUmbracoContextFactory umbracoContextFactory, IProfilingLogger logger)
|
||||
{
|
||||
_runtime = runtime;
|
||||
_contentService = contentService;
|
||||
_auditService = auditService;
|
||||
_scopeProvider = scopeProvider;
|
||||
_logger = logger;
|
||||
_umbracoContextFactory = umbracoContextFactory;
|
||||
|
||||
_healthChecks = healthChecks;
|
||||
_notifications = notifications;
|
||||
@@ -114,11 +116,11 @@ namespace Umbraco.Web.Scheduling
|
||||
{
|
||||
// scheduled publishing/unpublishing
|
||||
// install on all, will only run on non-replica servers
|
||||
var task = new ScheduledPublishing(_publishingRunner, 60000, 60000, _runtime, _contentService, _logger);
|
||||
var task = new ScheduledPublishing(_publishingRunner, 60000, 60000, _runtime, _contentService, _umbracoContextFactory, _logger);
|
||||
_publishingRunner.TryAdd(task);
|
||||
return task;
|
||||
}
|
||||
|
||||
|
||||
private IBackgroundTask RegisterHealthCheckNotifier(IHealthChecks healthCheckConfig,
|
||||
HealthCheckCollection healthChecks, HealthCheckNotificationMethodCollection notifications,
|
||||
IProfilingLogger logger)
|
||||
|
||||
Reference in New Issue
Block a user