Fixed bad assumption about HttpContext

HttpContext is not available when running at console
This commit is contained in:
PaulDevenney
2015-12-16 14:46:30 +00:00
parent 765f8f74a5
commit 52de937a21

View File

@@ -153,7 +153,9 @@ namespace Orchard.ImportExport.Providers.ImportActions {
PrepareRecipe(recipeDocument);
// Sets the request timeout to a configurable amount of seconds to give enough time to execute custom recipes.
_orchardServices.WorkContext.HttpContext.Server.ScriptTimeout = RecipeExecutionTimeout;
if (_orchardServices.WorkContext.HttpContext != null) {
_orchardServices.WorkContext.HttpContext.Server.ScriptTimeout = RecipeExecutionTimeout;
}
// Suspend background task execution.
_sweepGenerator.Terminate();