-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9859 from nzdev/v8/bugfix/fix-cold-boot
Reduce cold boot times by loading content and media only once on cold boot
- Loading branch information
Showing
14 changed files
with
179 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Umbraco.Core.Sync | ||
{ | ||
/// <summary> | ||
/// Retrieve the state of the sync service | ||
/// </summary> | ||
public interface ISyncBootStateAccessor | ||
{ | ||
/// <summary> | ||
/// Get the boot state | ||
/// </summary> | ||
/// <returns></returns> | ||
SyncBootState GetSyncBootState(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Umbraco.Core.Sync | ||
{ | ||
/// <summary> | ||
/// Boot state implementation for when umbraco is not in the run state | ||
/// </summary> | ||
public class NonRuntimeLevelBootStateAccessor : ISyncBootStateAccessor | ||
{ | ||
public SyncBootState GetSyncBootState() | ||
{ | ||
return SyncBootState.Unknown; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Umbraco.Core.Sync | ||
{ | ||
public enum SyncBootState | ||
{ | ||
/// <summary> | ||
/// Unknown state. Treat as HasSyncState | ||
/// </summary> | ||
Unknown = 0, | ||
/// <summary> | ||
/// Cold boot. No Sync state | ||
/// </summary> | ||
ColdBoot = 1, | ||
/// <summary> | ||
/// Warm boot. Sync state present | ||
/// </summary> | ||
HasSyncState = 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/Umbraco.Tests/TestHelpers/TestSyncBootStateAccessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Umbraco.Core.Sync; | ||
|
||
namespace Umbraco.Tests.TestHelpers | ||
{ | ||
class TestSyncBootStateAccessor : ISyncBootStateAccessor | ||
{ | ||
private readonly SyncBootState _syncBootState; | ||
|
||
public TestSyncBootStateAccessor(SyncBootState syncBootState) | ||
{ | ||
_syncBootState = syncBootState; | ||
} | ||
public SyncBootState GetSyncBootState() | ||
{ | ||
return _syncBootState; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters