From accf52ca387d6fff511ef39d0788331fa7e80b2d Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 24 Jul 2015 18:52:04 +0200 Subject: [PATCH] if user has explicitly opted out of index rebuild on startup, we must ensure that the database server messenger doesn't rebuild them either. --- src/Umbraco.Web/WebBootManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index b0c9c5298e..5b40a61c76 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -11,6 +11,7 @@ using System.Web.Mvc; using System.Web.Routing; using ClientDependency.Core.Config; using Examine; +using Examine.Config; using umbraco; using Umbraco.Core; using Umbraco.Core.Configuration; @@ -389,6 +390,11 @@ namespace Umbraco.Web // this callback is used below for the DatabaseServerMessenger startup options Action rebuildIndexes = () => { + //If the developer has explicitly opted out of rebuilding indexes on startup then we + // should adhere to that and not do it, this means that if they are load balancing things will be + // out of sync if they are auto-scaling but there's not much we can do about that. + if (ExamineSettings.Instance.RebuildOnAppStart == false) return; + if (_indexesToRebuild.Any()) { var otherIndexes = ExamineManager.Instance.IndexProviderCollection.Except(_indexesToRebuild);