Port v7@2aa0dfb2c5 - WIP

This commit is contained in:
Stephan
2018-03-27 10:04:07 +02:00
parent a2a4edb3be
commit 0a4878d2a3
119 changed files with 3016 additions and 1376 deletions

View File

@@ -66,15 +66,16 @@ namespace Umbraco.Web.Scheduling
_healthCheckRunner = new BackgroundTaskRunner<IBackgroundTask>("HealthCheckNotifier", logger);
// we will start the whole process when a successful request is made
UmbracoModule.RouteAttempt += UmbracoModuleRouteAttempt;
UmbracoModule.RouteAttempt += RegisterBackgroundTasksOnce;
}
private void UmbracoModuleRouteAttempt(object sender, RoutableAttemptEventArgs e)
private void RegisterBackgroundTasksOnce(object sender, RoutableAttemptEventArgs e)
{
switch (e.Outcome)
{
case EnsureRoutableOutcome.IsRoutable:
case EnsureRoutableOutcome.NotDocumentRequest:
UmbracoModule.RouteAttempt -= RegisterBackgroundTasksOnce;
RegisterBackgroundTasks();
break;
}
@@ -82,9 +83,6 @@ namespace Umbraco.Web.Scheduling
private void RegisterBackgroundTasks()
{
// remove handler, we're done
UmbracoModule.RouteAttempt -= UmbracoModuleRouteAttempt;
LazyInitializer.EnsureInitialized(ref _tasks, ref _started, ref _locker, () =>
{
_logger.Debug<SchedulerComponent>(() => "Initializing the scheduler");