From aa3f3ede8b51c9c1b6256e91e39e1e0bbc2f909a Mon Sep 17 00:00:00 2001 From: Renaud Paquay Date: Sat, 24 Jul 2010 15:32:16 -0700 Subject: [PATCH] Fix "feature enable" not working from command line --HG-- branch : dev --- src/Orchard/Commands/CommandHostAgent.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Orchard/Commands/CommandHostAgent.cs b/src/Orchard/Commands/CommandHostAgent.cs index 779713e1e..7a720155a 100644 --- a/src/Orchard/Commands/CommandHostAgent.cs +++ b/src/Orchard/Commands/CommandHostAgent.cs @@ -7,6 +7,7 @@ using System.Web.Routing; using Autofac; using Orchard.Environment; using Orchard.Environment.Configuration; +using Orchard.Environment.State; using Orchard.Localization; using Orchard.Logging; using Orchard.Tasks; @@ -54,8 +55,14 @@ namespace Orchard.Commands { }; env.Resolve().Execute(parameters); - return 0; } + + // in effect "pump messages" see PostMessage circa 1980 + var processingEngine = _hostContainer.Resolve(); + while (processingEngine.AreTasksPending()) + processingEngine.ExecuteNextTask(); + + return 0; } catch (OrchardCommandHostRetryException e) { // Special "Retry" return code for our host