From 0717d5b2467c78e24a5c0cbee7570e6b11e7fe8b Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 4 May 2020 18:57:55 +1000 Subject: [PATCH] Fixes: SqlMainDom setting for Azure does not work in Load Balancing #8038 --- src/Umbraco.Core/Runtime/SqlMainDomLock.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Runtime/SqlMainDomLock.cs b/src/Umbraco.Core/Runtime/SqlMainDomLock.cs index f3bfe4eefc..0107ecb8da 100644 --- a/src/Umbraco.Core/Runtime/SqlMainDomLock.cs +++ b/src/Umbraco.Core/Runtime/SqlMainDomLock.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Linq; using System.Threading; using System.Threading.Tasks; +using System.Web; using Umbraco.Core.Logging; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Dtos; @@ -16,7 +17,7 @@ namespace Umbraco.Core.Runtime internal class SqlMainDomLock : IMainDomLock { private string _lockId; - private const string MainDomKey = "Umbraco.Core.Runtime.SqlMainDom"; + private const string MainDomKeyPrefix = "Umbraco.Core.Runtime.SqlMainDom"; private const string UpdatedSuffix = "_updated"; private readonly ILogger _logger; private IUmbracoDatabase _db; @@ -126,6 +127,14 @@ namespace Umbraco.Core.Runtime } + /// + /// Returns the keyvalue table key for the current server/app + /// + private string MainDomKey { get; } = MainDomKeyPrefix + "-" + + (NetworkHelper.MachineName // eg DOMAIN\SERVER + + HttpRuntime.AppDomainAppId) // eg /LM/S3SVC/11/ROOT + .GenerateHash(); + private void ListeningLoop() { while (true)