From 7d20cf48df837ad851af6a21fafc6ecfdd125d62 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Wed, 21 Feb 2024 18:02:07 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=85=8D=E7=BD=AE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.ScheduledTask/Program.cs | 3 --- Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncOrganizationJob.cs | 2 +- Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs | 2 +- Src/Dlhis.ScheduledTask/appsettings.json | 3 +++ 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/Program.cs b/Src/Dlhis.ScheduledTask/Program.cs index 1060cca9..a69cba51 100644 --- a/Src/Dlhis.ScheduledTask/Program.cs +++ b/Src/Dlhis.ScheduledTask/Program.cs @@ -1,10 +1,7 @@ -using System.Net.NetworkInformation; using Kurisu.AspNetCore.Startup; using Kurisu.Startup; using Microsoft.AspNetCore.DataProtection; -using Microsoft.Extensions.Options; using StackExchange.Redis; -using static StackExchange.Redis.Role; class Program { diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncOrganizationJob.cs b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncOrganizationJob.cs index 66df77bc..2e7bc3e0 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncOrganizationJob.cs +++ b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncOrganizationJob.cs @@ -29,7 +29,7 @@ public class SyncOrganizationJob await SaveOrg(orgResult.Org.Items); } - var syncPositionJob = BackgroundJob.Enqueue(job => job.SyncPositionInfo()); + var syncPositionJob = BackgroundJob.Enqueue(job => job.RunAsync()); BackgroundJob.ContinueJobWith(syncPositionJob, job => job.RunAsync(), JobContinuationOptions.OnlyOnSucceededState); } diff --git a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs index 3a5e182e..96ff9411 100644 --- a/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs +++ b/Src/Dlhis.ScheduledTask/SyncSapInfo/Job/SyncPositionJob.cs @@ -19,7 +19,7 @@ public class SyncPositionJob _jinkoSapService = jinkoSapService; } - public async Task SyncPositionInfo() + public async Task RunAsync() { var positionResult = await _jinkoSapService.GetPositionsAsync(); diff --git a/Src/Dlhis.ScheduledTask/appsettings.json b/Src/Dlhis.ScheduledTask/appsettings.json index 7e6db3ba..ce8a7ff3 100644 --- a/Src/Dlhis.ScheduledTask/appsettings.json +++ b/Src/Dlhis.ScheduledTask/appsettings.json @@ -5,6 +5,9 @@ "Microsoft.AspNetCore": "Warning" } }, + "InternalRequest": { + "SysRequestUrl": "http://sys" + }, "SqlSugarOptions": { "DefaultConnectionString": "server=10.27.21.22;port=3306;userid=root;password=dlhis123;database=yikatong;charset=utf8mb4;", "SlaveConnectionString": [],