Adds notes

This commit is contained in:
Shannon
2019-01-30 16:56:14 +11:00
parent 16b655fd62
commit 35b78cc224
2 changed files with 13 additions and 1 deletions

View File

@@ -7,6 +7,10 @@ namespace Umbraco.Core.Sync
/// <summary>
/// A registrar that stores registered server nodes in the database.
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
public sealed class DatabaseServerRegistrar : IServerRegistrar
{
private readonly Lazy<IServerRegistrationService> _registrationService;

View File

@@ -3,6 +3,14 @@ using System.Collections.Generic;
namespace Umbraco.Core.Sync
{
/// <summary>
/// Can be used when Umbraco is definitely not operating in a Load Balanced scenario to micro-optimize some startup performance
/// </summary>
/// <remarks>
/// The micro optimization is specifically to avoid a DB query just after the app starts up to determine the <see cref="ServerRole"/>
/// 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.
/// </remarks>
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<IServerAddress[]>(() => new[] { new ServerAddressImpl(_runtime.ApplicationUrl.ToString()) });
_registrations = new Lazy<IServerAddress[]>(() => new IServerAddress[] { new ServerAddressImpl(_runtime.ApplicationUrl.ToString()) });
}
public ServerRole GetCurrentServerRole()