private void OnRouteAttempt(RoutableAttemptEventArgs args) { if (RouteAttempt != null) { RouteAttempt(this, args); } }
private void UmbracoModule_RouteAttempt(object sender, RoutableAttemptEventArgs e) { if (!_initialized) { lock (_locker) { // double check lock, we must only do this once if (!_initialized) { _initialized = true; UmbracoModule.RouteAttempt -= UmbracoModule_RouteAttempt; if (!_mainDom.IsMainDom) { return; } var bootState = _syncBootStateAccessor.GetSyncBootState(); _examineManager.ConfigureIndexes(_mainDom, _logger); // if it's a cold boot, rebuild all indexes including non-empty ones // delay one minute since a cold boot also triggers nucache rebuilds _indexRebuilder.RebuildIndexes(bootState != SyncBootState.ColdBoot, 60000); } } } }
// handles route attempts. private void UmbracoModuleRouteAttempt(object sender, RoutableAttemptEventArgs e) { if (e.HttpContext.Request == null || e.HttpContext.Request.Url == null) { return; } switch (e.Outcome) { case EnsureRoutableOutcome.IsRoutable: // front-end request RegisterServer(e); break; case EnsureRoutableOutcome.NotDocumentRequest: // anything else (back-end request, service...) //so it's not a document request, we'll check if it's a back office request if (e.HttpContext.Request.Url.IsBackOfficeRequest(HttpRuntime.AppDomainAppVirtualPath)) { RegisterServer(e); } break; /* * case EnsureRoutableOutcome.NotReady: * case EnsureRoutableOutcome.NotConfigured: * case EnsureRoutableOutcome.NoContent: * default: * // otherwise, do nothing * break; */ } }
private void UmbracoModuleRouteAttempt(object sender, RoutableAttemptEventArgs e) { switch (e.Outcome) { case EnsureRoutableOutcome.IsRoutable: case EnsureRoutableOutcome.NotDocumentRequest: RegisterBackgroundTasks(e); break; } }
private void UmbracoModule_RouteAttempt(object sender, RoutableAttemptEventArgs e) { // as long as umbraco is ready & configured, sync switch (e.Outcome) { case EnsureRoutableOutcome.IsRoutable: case EnsureRoutableOutcome.NotDocumentRequest: case EnsureRoutableOutcome.NoContent: Sync(); break; //case EnsureRoutableOutcome.NotReady: //case EnsureRoutableOutcome.NotConfigured: //default: // break; } }
/// <summary> /// Triggers the RouteAttempt event. /// </summary> internal static void OnRouteAttempt(object sender, RoutableAttemptEventArgs args) { RouteAttempt?.Invoke(sender, args); }