From 9eda07b25336637c7422b037957f050a3594ff8a Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 31 Aug 2023 16:20:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Startup.cs | 14 ++++++++++---- .../Service/Management/UserTypeService.cs | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index 769f9c9b7..b095f6b07 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -27,6 +27,8 @@ using Microsoft.AspNetCore.StaticFiles; using IRaCIS.Application.Services.BackGroundJob; using IRaCIS.Core.Application.Helper; using Microsoft.AspNetCore.Http; +using Autofac.Core; +using DocumentFormat.OpenXml.InkML; namespace IRaCIS.Core.API { @@ -92,7 +94,7 @@ namespace IRaCIS.Core.API }) .AddNewtonsoftJsonSetup(); // NewtonsoftJson 序列化 处理 - services.AddOptions().Configure( _configuration.GetSection("SystemEmailSendConfig")); + services.AddOptions().Configure(_configuration.GetSection("SystemEmailSendConfig")); services.AddOptions().Configure(_configuration.GetSection("BasicSystemConfig")); @@ -165,7 +167,7 @@ namespace IRaCIS.Core.API } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + public async void Configure(IApplicationBuilder app, IWebHostEnvironment env) { //app.UsePathBase(PathString.FromUriComponent("/api")); @@ -213,7 +215,7 @@ namespace IRaCIS.Core.API app.UseStatusCodePagesWithReExecute("/Error/{0}"); SwaggerSetup.Configure(app, env); - + ////serilog 记录请求的用户信息 @@ -242,7 +244,11 @@ namespace IRaCIS.Core.API }); - HangfireJobHelper.NotImmediatelyOnceOnlyJob(t => t.InitHangfireJobTaskAsync(),TimeSpan.FromSeconds(1)); + var hangfireJobService = app.ApplicationServices.GetRequiredService(); + + await hangfireJobService.InitHangfireJobTaskAsync(); + //有的时候每调用 + //HangfireJobHelper.NotImmediatelyOnceOnlyJob(t => t.InitHangfireJobTaskAsync(),TimeSpan.FromSeconds(1)); } diff --git a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs index c6b5a168e..fb534f4e9 100644 --- a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs @@ -119,7 +119,7 @@ namespace IRaCIS.Core.Application.Contracts } else { - userTypeEnums = new List() { UserTypeEnum.PI, UserTypeEnum.MIM }; + userTypeEnums = new List() { UserTypeEnum.PI, UserTypeEnum.MIM , UserTypeEnum.IQC}; } }