diff --git a/src/Orchard.Web/Config/HostComponents.config b/src/Orchard.Web/Config/HostComponents.config index dd1a321d6..f91398632 100644 --- a/src/Orchard.Web/Config/HostComponents.config +++ b/src/Orchard.Web/Config/HostComponents.config @@ -106,5 +106,19 @@ + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ImportExport/Providers/ImportActions/ExecuteRecipeAction.cs b/src/Orchard.Web/Modules/Orchard.ImportExport/Providers/ImportActions/ExecuteRecipeAction.cs index da7f43edf..fa3cdb7cd 100644 --- a/src/Orchard.Web/Modules/Orchard.ImportExport/Providers/ImportActions/ExecuteRecipeAction.cs +++ b/src/Orchard.Web/Modules/Orchard.ImportExport/Providers/ImportActions/ExecuteRecipeAction.cs @@ -51,13 +51,16 @@ namespace Orchard.ImportExport.Providers.ImportActions { _sweepGenerator = sweepGenerator; _recipeStepQueue = recipeStepQueue; _recipeStepResultRepository = recipeStepResultRepository; - } + + RecipeExecutionTimeout = 600; + } public override string Name { get { return "ExecuteRecipe"; } } public XDocument RecipeDocument { get; set; } public bool ResetSite { get; set; } public string SuperUserPassword { get; set; } + public int RecipeExecutionTimeout { get; set; } public override dynamic BuildEditor(dynamic shapeFactory) { return UpdateEditor(shapeFactory, null); @@ -149,8 +152,8 @@ namespace Orchard.ImportExport.Providers.ImportActions { // Give each execution step a chance to augment the recipe step before it will be scheduled. PrepareRecipe(recipeDocument); - // Sets the request timeout to 10 minutes to give enough time to execute custom recipes. - _orchardServices.WorkContext.HttpContext.Server.ScriptTimeout = 600; + // Sets the request timeout to a configurable amount of seconds to give enough time to execute custom recipes. + _orchardServices.WorkContext.HttpContext.Server.ScriptTimeout = RecipeExecutionTimeout; // Suspend background task execution. _sweepGenerator.Terminate(); diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs index ae185848e..8c2eb4687 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs +++ b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs @@ -33,10 +33,12 @@ namespace Orchard.Setup.Controllers { T = NullLocalizer.Instance; Logger = NullLogger.Instance; + RecipeExecutionTimeout = 600; } public Localizer T { get; set; } public ILogger Logger { get; set; } + public int RecipeExecutionTimeout { get; set; } private ActionResult IndexViewResult(SetupViewModel model) { return View(model); @@ -70,8 +72,8 @@ namespace Orchard.Setup.Controllers { [HttpPost, ActionName("Index")] public ActionResult IndexPOST(SetupViewModel model) { - // Sets the setup request timeout to 10 minutes to give enough time to execute custom recipes. - HttpContext.Server.ScriptTimeout = 600; + // Sets the setup request timeout to a configurable amount of seconds to give enough time to execute custom recipes. + HttpContext.Server.ScriptTimeout = RecipeExecutionTimeout; var recipes = _setupService.Recipes().ToList(); diff --git a/src/Orchard/Environment/ShellBuilders/ShellContainerFactory.cs b/src/Orchard/Environment/ShellBuilders/ShellContainerFactory.cs index 145f40f98..e621c6a6b 100644 --- a/src/Orchard/Environment/ShellBuilders/ShellContainerFactory.cs +++ b/src/Orchard/Environment/ShellBuilders/ShellContainerFactory.cs @@ -135,6 +135,10 @@ namespace Orchard.Environment.ShellBuilders { if (File.Exists(optionalShellConfig)) builder.RegisterModule(new ConfigurationSettingsReader(ConfigurationSettingsReaderConstants.DefaultSectionName, optionalShellConfig)); } + + var optionalComponentsConfig = HostingEnvironment.MapPath("~/Config/HostComponents.config"); + if (File.Exists(optionalComponentsConfig)) + builder.RegisterModule(new HostComponentsConfigModule(optionalComponentsConfig)); }); }