Browse Source

fix(tasks): fixed task run time.

pull/959/head
colin 2 years ago
parent
commit
6e073dc865
  1. 8
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs

8
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs

@ -128,13 +128,13 @@ public class QuartzJobListener : JobListenerSupport, ISingletonDependency
jobEventData.RepeatCount = simpleTrigger.RepeatCount; jobEventData.RepeatCount = simpleTrigger.RepeatCount;
} }
jobEventData.Description = context.JobDetail.Description; jobEventData.Description = context.JobDetail.Description;
jobEventData.RunTime = Clock.Normalize(context.FireTimeUtc.DateTime); jobEventData.RunTime = Clock.Normalize(context.FireTimeUtc.LocalDateTime);
var lastRunTime = context.PreviousFireTimeUtc?.DateTime ?? context.Trigger.GetPreviousFireTimeUtc()?.DateTime; var lastRunTime = context.PreviousFireTimeUtc?.LocalDateTime ?? context.Trigger.GetPreviousFireTimeUtc()?.LocalDateTime;
if (lastRunTime.HasValue) 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) if (nextRunTime.HasValue)
{ {
jobEventData.NextRunTime = Clock.Normalize(nextRunTime.Value); jobEventData.NextRunTime = Clock.Normalize(nextRunTime.Value);

Loading…
Cancel
Save