("Umbraco application startup complete" + " (took " + x + "ms)"));
//create the ApplicationContext
- ApplicationContext = ApplicationContext.Current = new ApplicationContext()
- {
- IsReady = true // fixme
- };
+ ApplicationContext = ApplicationContext.Current = new ApplicationContext();
InitializeResolvers();
diff --git a/src/Umbraco.Web.UI/config/splashes/booting.aspx b/src/Umbraco.Web.UI/config/splashes/booting.aspx
index 75e74410e9..39e97e4ffe 100644
--- a/src/Umbraco.Web.UI/config/splashes/booting.aspx
+++ b/src/Umbraco.Web.UI/config/splashes/booting.aspx
@@ -1,19 +1,18 @@
-<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="booting.aspx.cs" Inherits="umbraco.presentation.config.splashes.booting" %>
+<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %>
- Website booting
- ">
+ The website is restarting
+ ">
- Website is restarting
- The webpage cannot be displayed right now.
- This page will refresh in ten seconds.
+ The website is restarting
+ Please wait for 10s while we prepare to serve the page you have requested...
-
-
You can modify the design of this page by editing /config/splashes/booting.aspx
-
+
+ You can modify the design of this page by editing /config/splashes/booting.aspx
+
diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs
index d35cd99f91..db5286a7ad 100644
--- a/src/Umbraco.Web/UmbracoModule.cs
+++ b/src/Umbraco.Web/UmbracoModule.cs
@@ -283,52 +283,58 @@ namespace Umbraco.Web
// if yes, return true
bool EnsureIsReady(HttpContextBase httpContext, Uri uri)
{
+ var ready = ApplicationContext.Current.IsReady;
+
// ensure we are ready
- if (!ApplicationContext.Current.IsReady)
+ if (!ready)
{
LogHelper.Warn("Umbraco is not ready");
- httpContext.Response.StatusCode = 503;
-
- // fixme - default.aspx has to be ready for RequestContext.DocumentRequest==null
- // fixme - in fact we should transfer to an empty html page...
- var bootUrl = UriUtility.ToAbsolute(UmbracoSettings.BootSplashPage);
-
- if (UmbracoSettings.EnableSplashWhileLoading) // legacy - should go
+ if (!UmbracoSettings.EnableSplashWhileLoading)
{
- var configPath = UriUtility.ToAbsolute(SystemDirectories.Config);
- bootUrl = string.Format("{0}/splashes/booting.aspx?url={1}", configPath, HttpUtility.UrlEncode(uri.ToString()));
- // fixme ?orgurl=... ?retry=...
+ // let requests pile up and wait for 10s then show the splash anyway
+ ready = ApplicationContext.Current.WaitForReady(10 * 1000);
}
- httpContext.RewritePath(bootUrl);
+ if (!ready)
+ {
+ httpContext.Response.StatusCode = 503;
- return false;
+ var bootUrl = UmbracoSettings.BootSplashPage;
+ if (string.IsNullOrWhiteSpace(bootUrl))
+ bootUrl = "~/config/splashes/booting.aspx";
+ httpContext.RewritePath(UriUtility.ToAbsolute(bootUrl) + "?url=" + HttpUtility.UrlEncode(uri.ToString()));
+
+ return false;
+ }
}
return true;
}
- // ensures Umbraco has at least one published node
- // if not, rewrites to splash and return false
- // if yes, return true
- bool EnsureHasContent(HttpContextBase httpContext)
- {
- var context = UmbracoContext.Current;
- var store = context.RoutingContext.PublishedContentStore;
- if (!store.HasContent(context))
- {
- LogHelper.Warn("Umbraco has not content");
+ // ensures Umbraco has at least one published node
+ // if not, rewrites to splash and return false
+ // if yes, return true
+ bool EnsureHasContent(HttpContextBase httpContext)
+ {
+ var context = UmbracoContext.Current;
+ var store = context.RoutingContext.PublishedContentStore;
+ if (!store.HasContent(context))
+ {
+ LogHelper.Warn("Umbraco has no content");
- var noContentUrl = UriUtility.ToAbsolute(UmbracoSettings.NoContentSplashPage);
- httpContext.RewritePath(noContentUrl);
- return false;
- }
- else
- {
- return true;
- }
- }
+ httpContext.Response.StatusCode = 503;
+
+ var noContentUrl = "~/config/splashes/noNodes.aspx";
+ httpContext.RewritePath(UriUtility.ToAbsolute(noContentUrl));
+
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
// ensures Umbraco is configured
// if not, redirect to install and return false
diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs
index 36c4b2ff44..5c4184e7c5 100644
--- a/src/Umbraco.Web/WebBootManager.cs
+++ b/src/Umbraco.Web/WebBootManager.cs
@@ -108,6 +108,9 @@ namespace Umbraco.Web
ApplicationEventsResolver.Current.ApplicationEventHandlers
.ForEach(x => x.OnApplicationStarted(_umbracoApplication, ApplicationContext));
+ // we're ready to serve content!
+ ApplicationContext.IsReady = true;
+
return this;
}