mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-18 19:51:45 +08:00
Don't run background tasks in command-line host
--HG-- branch : dev
This commit is contained in:
9
src/Orchard/Commands/CommandBackgroundService.cs
Normal file
9
src/Orchard/Commands/CommandBackgroundService.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using Orchard.Tasks;
|
||||||
|
|
||||||
|
namespace Orchard.Commands {
|
||||||
|
public class CommandBackgroundService : IBackgroundService {
|
||||||
|
public void Sweep() {
|
||||||
|
// Don't run any background service in command line
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ using Orchard.Environment;
|
|||||||
using Orchard.Environment.Configuration;
|
using Orchard.Environment.Configuration;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.Logging;
|
using Orchard.Logging;
|
||||||
|
using Orchard.Tasks;
|
||||||
|
|
||||||
namespace Orchard.Commands {
|
namespace Orchard.Commands {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -141,6 +142,7 @@ namespace Orchard.Commands {
|
|||||||
protected void ContainerRegistrations(ContainerBuilder builder) {
|
protected void ContainerRegistrations(ContainerBuilder builder) {
|
||||||
MvcSingletons(builder);
|
MvcSingletons(builder);
|
||||||
builder.RegisterType<CommandHostEnvironment>().As<IHostEnvironment>();
|
builder.RegisterType<CommandHostEnvironment>().As<IHostEnvironment>();
|
||||||
|
builder.RegisterType<CommandBackgroundService>().As<IBackgroundService>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void MvcSingletons(ContainerBuilder builder) {
|
protected void MvcSingletons(ContainerBuilder builder) {
|
||||||
|
|||||||
@@ -135,6 +135,7 @@
|
|||||||
<Compile Include="Caching\Signals.cs" />
|
<Compile Include="Caching\Signals.cs" />
|
||||||
<Compile Include="Collections\IPageOfItems.cs" />
|
<Compile Include="Collections\IPageOfItems.cs" />
|
||||||
<Compile Include="Collections\PageOfItems.cs" />
|
<Compile Include="Collections\PageOfItems.cs" />
|
||||||
|
<Compile Include="Commands\CommandBackgroundService.cs" />
|
||||||
<Compile Include="Commands\CommandHostEnvironment.cs" />
|
<Compile Include="Commands\CommandHostEnvironment.cs" />
|
||||||
<Compile Include="ContentManagement\Aspects\ICommonAspect.cs">
|
<Compile Include="ContentManagement\Aspects\ICommonAspect.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
|
|||||||
Reference in New Issue
Block a user