routing - handle when umbraco is not ready or has no content

This commit is contained in:
Stephan
2012-09-28 11:11:47 -02:00
parent d82cbfccc5
commit abe4944843
6 changed files with 58 additions and 51 deletions

View File

@@ -36,6 +36,7 @@ namespace Umbraco.Core
// note - the original umbraco module checks on content.Instance in umbraco.dll
// now, the boot task that setup the content store ensures that it is ready
bool _isReady = false;
System.Threading.ManualResetEventSlim _isReadyEvent = new System.Threading.ManualResetEventSlim(false);
public bool IsReady
{
get
@@ -46,9 +47,15 @@ namespace Umbraco.Core
{
AssertIsNotReady();
_isReady = value;
_isReadyEvent.Set();
}
}
public bool WaitForReady(int timeout)
{
return _isReadyEvent.WaitHandle.WaitOne(timeout);
}
// notes
// GlobalSettings.ConfigurationStatus returns the value that's in the web.config, so it's the "configured version"