From d8b6f1fef15a36b9ae4e9c35c4f7ea48adcf4a83 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 16 Jul 2015 15:52:22 +0200 Subject: [PATCH] Fixes database server messenger to not bind to events if we're not installed, otherwise we get ysods (not sure if there was a typo there or not, but should defo not boot when not installed) --- .../BatchedDatabaseServerMessenger.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web/BatchedDatabaseServerMessenger.cs b/src/Umbraco.Web/BatchedDatabaseServerMessenger.cs index 1e4f94a3c0..4eeb5c84f9 100644 --- a/src/Umbraco.Web/BatchedDatabaseServerMessenger.cs +++ b/src/Umbraco.Web/BatchedDatabaseServerMessenger.cs @@ -30,15 +30,18 @@ namespace Umbraco.Web private void Application_Started(object sender, EventArgs eventArgs) { - if (ApplicationContext.IsConfigured == false - || ApplicationContext.DatabaseContext.IsDatabaseConfigured == false + if (ApplicationContext.IsConfigured == false + || ApplicationContext.DatabaseContext.IsDatabaseConfigured == false || ApplicationContext.DatabaseContext.CanConnect == false) + { - LogHelper.Warn("The app is not configured or cannot connect to the database, this server cannot be initialized with " - + typeof(BatchedDatabaseServerMessenger) + ", distributed calls will not be enabled for this server"); - - // because .ApplicationStarted triggers only once, this is thread-safe - Boot(); + LogHelper.Warn("The app is not configured or cannot connect to the database, this server cannot be initialized with " + + typeof (BatchedDatabaseServerMessenger) + ", distributed calls will not be enabled for this server"); + } + else + { + Boot(); + } } private void UmbracoModule_RouteAttempt(object sender, RoutableAttemptEventArgs e)