diff --git a/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs b/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs index 9ad5875edf..276ce6097c 100644 --- a/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs +++ b/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs @@ -7,6 +7,10 @@ namespace Umbraco.Core.Sync /// /// A registrar that stores registered server nodes in the database. /// + /// + /// This is the default registrar which determines a server's role by using a master election process. + /// The master election process doesn't occur until just after startup so this election process doesn't really affect the primary startup phase. + /// public sealed class DatabaseServerRegistrar : IServerRegistrar { private readonly Lazy _registrationService; diff --git a/src/Umbraco.Core/Sync/SingleServerRegistrar.cs b/src/Umbraco.Core/Sync/SingleServerRegistrar.cs index edd14e9f5c..b29533dd51 100644 --- a/src/Umbraco.Core/Sync/SingleServerRegistrar.cs +++ b/src/Umbraco.Core/Sync/SingleServerRegistrar.cs @@ -3,6 +3,14 @@ using System.Collections.Generic; namespace Umbraco.Core.Sync { + /// + /// Can be used when Umbraco is definitely not operating in a Load Balanced scenario to micro-optimize some startup performance + /// + /// + /// The micro optimization is specifically to avoid a DB query just after the app starts up to determine the + /// which by default is done with master election by a database query. The master election process doesn't occur until just after startup + /// so this micro optimization doesn't really affect the primary startup phase. + /// public class SingleServerRegistrar : IServerRegistrar { private readonly IRuntimeState _runtime; @@ -13,7 +21,7 @@ namespace Umbraco.Core.Sync public SingleServerRegistrar(IRuntimeState runtime) { _runtime = runtime; - _registrations = new Lazy(() => new[] { new ServerAddressImpl(_runtime.ApplicationUrl.ToString()) }); + _registrations = new Lazy(() => new IServerAddress[] { new ServerAddressImpl(_runtime.ApplicationUrl.ToString()) }); } public ServerRole GetCurrentServerRole()