From 6e073dc86518a25c6915f7b23b2d671b985f12e6 Mon Sep 17 00:00:00 2001 From: colin Date: Mon, 3 Jun 2024 08:37:45 +0800 Subject: [PATCH] fix(tasks): fixed task run time. --- .../Abp/BackgroundTasks/Quartz/QuartzJobListener.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs index 066c92913..4dab915e0 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs @@ -128,13 +128,13 @@ public override async Task JobWasExecuted(IJobExecutionContext context, JobExecu jobEventData.RepeatCount = simpleTrigger.RepeatCount; } jobEventData.Description = context.JobDetail.Description; - jobEventData.RunTime = Clock.Normalize(context.FireTimeUtc.DateTime); - var lastRunTime = context.PreviousFireTimeUtc?.DateTime ?? context.Trigger.GetPreviousFireTimeUtc()?.DateTime; + jobEventData.RunTime = Clock.Normalize(context.FireTimeUtc.LocalDateTime); + var lastRunTime = context.PreviousFireTimeUtc?.LocalDateTime ?? context.Trigger.GetPreviousFireTimeUtc()?.LocalDateTime; if (lastRunTime.HasValue) { - jobEventData.RunTime = Clock.Normalize(lastRunTime.Value); + jobEventData.LastRunTime = Clock.Normalize(lastRunTime.Value); } - var nextRunTime = context.NextFireTimeUtc?.DateTime ?? context.Trigger.GetNextFireTimeUtc()?.DateTime; + var nextRunTime = context.NextFireTimeUtc?.LocalDateTime ?? context.Trigger.GetNextFireTimeUtc()?.LocalDateTime; if (nextRunTime.HasValue) { jobEventData.NextRunTime = Clock.Normalize(nextRunTime.Value);