Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d230a7b01 | |||
| 18c5348bdf | |||
| c50fea9794 |
@@ -0,0 +1,24 @@
|
|||||||
|
namespace Umbraco.Core.Sync
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The type of Cold Boot taking place
|
||||||
|
/// </summary>
|
||||||
|
public enum ColdBootType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates there was no cold boot
|
||||||
|
/// </summary>
|
||||||
|
NoColdBoot,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This indicates that there is no lasysynced file for the current machine/appid
|
||||||
|
/// </summary>
|
||||||
|
NeverSynced,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This indicates that the number of instructions needing to be processed exceeds the value stored
|
||||||
|
/// for the <see cref="DatabaseServerMessengerOptions.MaxProcessingInstructionCount"/>
|
||||||
|
/// </summary>
|
||||||
|
ExceedsMaxProcessingInstructionCount
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,6 +43,11 @@ namespace Umbraco.Core.Sync
|
|||||||
protected DatabaseServerMessengerOptions Options { get; private set; }
|
protected DatabaseServerMessengerOptions Options { get; private set; }
|
||||||
protected ApplicationContext ApplicationContext { get { return _appContext; } }
|
protected ApplicationContext ApplicationContext { get { return _appContext; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cold boot type detected for the current app domain
|
||||||
|
/// </summary>
|
||||||
|
public ColdBootType ColdBootType { get; private set; }
|
||||||
|
|
||||||
public DatabaseServerMessenger(ApplicationContext appContext, bool distributedEnabled, DatabaseServerMessengerOptions options)
|
public DatabaseServerMessenger(ApplicationContext appContext, bool distributedEnabled, DatabaseServerMessengerOptions options)
|
||||||
: base(distributedEnabled)
|
: base(distributedEnabled)
|
||||||
{
|
{
|
||||||
@@ -146,11 +151,12 @@ namespace Umbraco.Core.Sync
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
private void Initialize()
|
private void Initialize()
|
||||||
{
|
{
|
||||||
|
ColdBootType = ColdBootType.NoColdBoot;
|
||||||
|
|
||||||
lock (_locko)
|
lock (_locko)
|
||||||
{
|
{
|
||||||
if (_released) return;
|
if (_released) return;
|
||||||
|
|
||||||
var coldboot = false;
|
|
||||||
if (_lastId < 0) // never synced before
|
if (_lastId < 0) // never synced before
|
||||||
{
|
{
|
||||||
// we haven't synced - in this case we aren't going to sync the whole thing, we will assume this is a new
|
// we haven't synced - in this case we aren't going to sync the whole thing, we will assume this is a new
|
||||||
@@ -159,7 +165,7 @@ namespace Umbraco.Core.Sync
|
|||||||
+ " The server will build its caches and indexes, and then adjust its last synced Id to the latest found in"
|
+ " The server will build its caches and indexes, and then adjust its last synced Id to the latest found in"
|
||||||
+ " the database and maintain cache updates based on that Id.");
|
+ " the database and maintain cache updates based on that Id.");
|
||||||
|
|
||||||
coldboot = true;
|
ColdBootType = ColdBootType.NeverSynced;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -175,11 +181,11 @@ namespace Umbraco.Core.Sync
|
|||||||
+ " to the latest found in the database and maintain cache updates based on that Id.",
|
+ " to the latest found in the database and maintain cache updates based on that Id.",
|
||||||
() => count, () => Options.MaxProcessingInstructionCount);
|
() => count, () => Options.MaxProcessingInstructionCount);
|
||||||
|
|
||||||
coldboot = true;
|
ColdBootType = ColdBootType.ExceedsMaxProcessingInstructionCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coldboot)
|
if (ColdBootType != ColdBootType.NoColdBoot)
|
||||||
{
|
{
|
||||||
// go get the last id in the db and store it
|
// go get the last id in the db and store it
|
||||||
// note: do it BEFORE initializing otherwise some instructions might get lost
|
// note: do it BEFORE initializing otherwise some instructions might get lost
|
||||||
|
|||||||
@@ -1311,6 +1311,7 @@
|
|||||||
<Compile Include="Strings\ContentBaseExtensions.cs" />
|
<Compile Include="Strings\ContentBaseExtensions.cs" />
|
||||||
<Compile Include="Strings\Diff.cs" />
|
<Compile Include="Strings\Diff.cs" />
|
||||||
<Compile Include="Sync\BatchedWebServiceServerMessenger.cs" />
|
<Compile Include="Sync\BatchedWebServiceServerMessenger.cs" />
|
||||||
|
<Compile Include="Sync\ColdBootType.cs" />
|
||||||
<Compile Include="Sync\IServerRegistrar2.cs" />
|
<Compile Include="Sync\IServerRegistrar2.cs" />
|
||||||
<Compile Include="Sync\ServerRole.cs" />
|
<Compile Include="Sync\ServerRole.cs" />
|
||||||
<Compile Include="Sync\DatabaseServerMessenger.cs" />
|
<Compile Include="Sync\DatabaseServerMessenger.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user