mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Merge pull request #5815 from OrchardCMS/issue/recipeexecutiontimeout
Added configurable RecipeExecutionTimeout properties.
This commit is contained in:
@@ -106,5 +106,19 @@
|
||||
</Properties>
|
||||
</Component>
|
||||
|
||||
<Component Type="Orchard.Setup.Controllers.SetupController">
|
||||
<Properties>
|
||||
<!-- Sets the request timeout to a configurable amount of seconds to give enough time to execute setup recipes. -->
|
||||
<Property Name="RecipeExecutionTimeout" Value="600"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
|
||||
<Component Type="Orchard.ImportExport.Providers.ImportActions.ExecuteRecipeAction">
|
||||
<Properties>
|
||||
<!-- Sets the request timeout to a configurable amount of seconds to give enough time to execute imported recipes. -->
|
||||
<Property Name="RecipeExecutionTimeout" Value="600"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
|
||||
</Components>
|
||||
</HostComponents>
|
||||
|
@@ -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();
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user