mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-18 09:44:20 +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.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Tasks;
|
||||
|
||||
namespace Orchard.Commands {
|
||||
/// <summary>
|
||||
@@ -141,6 +142,7 @@ namespace Orchard.Commands {
|
||||
protected void ContainerRegistrations(ContainerBuilder builder) {
|
||||
MvcSingletons(builder);
|
||||
builder.RegisterType<CommandHostEnvironment>().As<IHostEnvironment>();
|
||||
builder.RegisterType<CommandBackgroundService>().As<IBackgroundService>();
|
||||
}
|
||||
|
||||
protected void MvcSingletons(ContainerBuilder builder) {
|
||||
|
@@ -135,6 +135,7 @@
|
||||
<Compile Include="Caching\Signals.cs" />
|
||||
<Compile Include="Collections\IPageOfItems.cs" />
|
||||
<Compile Include="Collections\PageOfItems.cs" />
|
||||
<Compile Include="Commands\CommandBackgroundService.cs" />
|
||||
<Compile Include="Commands\CommandHostEnvironment.cs" />
|
||||
<Compile Include="ContentManagement\Aspects\ICommonAspect.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
Reference in New Issue
Block a user