doc BatchedDatabaseServerMessenger startup

This commit is contained in:
Stephan
2015-07-29 11:22:12 +02:00
parent 1eab92b299
commit 308f64a7e2
3 changed files with 28 additions and 23 deletions

View File

@@ -11,23 +11,12 @@ namespace Umbraco.Web
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
var msgr = ServerMessengerResolver.HasCurrent ? ServerMessengerResolver.Current.Messenger as BatchedDatabaseServerMessenger : null;
var messenger = ServerMessengerResolver.HasCurrent
? ServerMessengerResolver.Current.Messenger as BatchedDatabaseServerMessenger
: null;
if (msgr == null) return;
UmbracoModule.EndRequest += msgr.UmbracoModule_EndRequest;
UmbracoModule.RouteAttempt += msgr.UmbracoModule_RouteAttempt;
if (applicationContext.DatabaseContext.IsDatabaseConfigured == false || applicationContext.DatabaseContext.CanConnect == false)
{
applicationContext.ProfilingLogger.Logger.Warn<BatchedDatabaseServerMessenger>(
"The app cannot connect to the database, this server cannot be initialized with "
+ typeof(BatchedDatabaseServerMessenger) + ", distributed calls will not be enabled for this server");
}
else
{
msgr.Boot();
}
if (messenger != null)
messenger.Startup();
}
}
}