增加后台服务 是否开启
This commit is contained in:
1 parent
c714bbea64
commit
1142c6f05a
2 files changed
+12
-5
No files matched your search
@@ -8,6 +8,7 @@ using MAX.Core.DependencyInjection;
|
||||
using MAX.Core.Logger;
|
||||
using MAX.Framework.Logger;
|
||||
using MySql.Data.MySqlClient;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using NLog;
|
||||
using Store.Framework.DependencyInjection;
|
||||
@@ -36,12 +37,16 @@ namespace KJD_Web
|
||||
GlobalConfiguration.Configuration.DependencyResolver =
|
||||
new AutofacWebApiDependencyResolver(container);
|
||||
|
||||
ContainerConfig.BuildHangfire(GlobalConfiguration.Configuration.DependencyResolver);
|
||||
bool BackgroundJobs = System.Configuration.ConfigurationManager.AppSettings["BackgroundJobs"].ParseToBool();
|
||||
if (BackgroundJobs)
|
||||
{
|
||||
ContainerConfig.BuildHangfire(GlobalConfiguration.Configuration.DependencyResolver);
|
||||
}
|
||||
|
||||
GlobalConfiguration.Configure(WebApiConfig.Register);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected void Session_Start(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -28,9 +28,11 @@
|
||||
</connectionStrings>
|
||||
<appSettings>
|
||||
<!-- 禁用 OWIN 启动类的自动发现,避免与现有项目结构冲突 -->
|
||||
<add key="owin:AutomaticAppStartup" value="true" />
|
||||
<add key="Hangfire:User" value="admin" />
|
||||
<add key="Hangfire:Password" value="hangadmin" />
|
||||
<add key="owin:AutomaticAppStartup" value="false" />
|
||||
<!--<add key="Hangfire:User" value="admin" />
|
||||
<add key="Hangfire:Password" value="hangadmin" />-->
|
||||
<!--是否启用后台任务-->
|
||||
<add key="BackgroundJobs" value="false"/>
|
||||
</appSettings>
|
||||
<!--
|
||||
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
|
||||
|
||||
Reference in new issue
Block a user