adds appSetting to switch maindom lock
This commit is contained in:
@@ -9,6 +9,8 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
public static class AppSettings
|
||||
{
|
||||
public const string MainDomLock = "Umbraco.Core.MainDom.Lock";
|
||||
|
||||
// TODO: Kill me - still used in Umbraco.Core.IO.SystemFiles:27
|
||||
[Obsolete("We need to kill this appsetting as we do not use XML content cache umbraco.config anymore due to NuCache")]
|
||||
public const string ContentXML = "Umbraco.Core.ContentXML"; //umbracoContentXML
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using System.Threading;
|
||||
using System.Configuration;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging.Serilog;
|
||||
using Umbraco.Core.Runtime;
|
||||
using Umbraco.Web.Runtime;
|
||||
|
||||
namespace Umbraco.Web
|
||||
@@ -14,7 +16,17 @@ namespace Umbraco.Web
|
||||
protected override IRuntime GetRuntime()
|
||||
{
|
||||
var logger = SerilogLogger.CreateWithDefaultConfiguration();
|
||||
return new WebRuntime(this, logger, new MainDom(logger));
|
||||
|
||||
// Determine if we should use the sql main dom or the default
|
||||
var appSettingMainDomLock = ConfigurationManager.AppSettings[Constants.AppSettings.MainDomLock];
|
||||
|
||||
var mainDomLock = appSettingMainDomLock == "SqlMainDomLock"
|
||||
? (IMainDomLock)new SqlMainDomLock(logger)
|
||||
: new MainDomSemaphoreLock();
|
||||
|
||||
var runtime = new WebRuntime(this, logger, new MainDom(logger, mainDomLock));
|
||||
|
||||
return runtime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user