From fc9cba5f058089887aa7061d2e6b4006b9e04a9a Mon Sep 17 00:00:00 2001
From: 陈勇 <竞男@ASUNA>
Date: 星期二, 10 三月 2026 09:46:43 +0800
Subject: [PATCH] 同步

---
 项目代码/WMS/WMSServer/WIDESEA_WMSServer/Program.cs |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_WMSServer/Program.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_WMSServer/Program.cs"
index b9b5901..b66dbe8 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_WMSServer/Program.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_WMSServer/Program.cs"
@@ -20,6 +20,8 @@
 using Swashbuckle.AspNetCore.SwaggerGen;
 using Microsoft.OpenApi.Models;
 using WIDESEA_StorageTaskServices;
+using Quartz.Spi;
+using WIDESEA.QuartzJob;
 
 var builder = WebApplication.CreateBuilder(args);
 
@@ -54,7 +56,10 @@
 
 builder.Services.AddSwaggerSetup();
 
-builder.Services.AddJobSetup();//任务调度 启动服务
+
+builder.Services.AddSingleton<IJobFactory, JobFactory>();
+builder.Services.AddTransient<BackgroundJob>();//Job使用瞬时依赖注入
+builder.Services.AddSingleton<ISchedulerCenter, SchedulerCenterServer>();
 
 builder.Services.AddHttpContextSetup();
 
@@ -115,6 +120,7 @@
 
 var app = builder.Build();
 
+app.UseQuartzJobMildd();
 // 3、配置中间件
 app.UseMiniProfiler();//性能分析器
 app.ConfigureApplication();//配置文件

--
Gitblit v1.9.3