From 7c0c096be4c8154cb5cd683176e921648323eb47 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 24 Aug 2023 11:38:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=82=AE=E4=BB=B6=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=AE=E6=94=B9--023?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Startup.cs | 6 ++++++ IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs | 3 +-- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index 3300796eb..a935dd00e 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -24,6 +24,8 @@ using Invio.Extensions.Authentication.JwtBearer; using Microsoft.AspNetCore.SignalR; using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.StaticFiles; +using IRaCIS.Application.Services.BackGroundJob; +using IRaCIS.Core.Application.Helper; namespace IRaCIS.Core.API { @@ -236,6 +238,10 @@ namespace IRaCIS.Core.API endpoints.MapHub("/UploadHub"); }); + + HangfireJobHelper.NotImmediatelyOnceOnlyJob(t => t.InitHangfireJobTaskAsync(),TimeSpan.FromSeconds(1)); + + } } } diff --git a/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs index e246d42c2..310f7aaf2 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs @@ -35,8 +35,7 @@ namespace IRaCIS.Core.API services.AddHangfireServer(option => { - option.ServerName = "test_study"; - option.Queues = new[] { "immediately_once","default" }; + option.Queues = new[] { "immediately_once","default","sys_init" , "not_immediately_once" }; }); } diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index f7f0eeae5..bcb6721a7 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -56,7 +56,7 @@ namespace IRaCIS.Application.Services.BackGroundJob //初始化 - //await InitInternationlizationDataAndWatchJsonFileAsync(); + await InitInternationlizationDataAndWatchJsonFileAsync(); //创建邮件定时任务