Browse Source

Merge pull request #959 from colinin/fixed-task-run-time

fix(tasks): fixed task run time.
pull/953/merge
yx lin 2 years ago
committed by GitHub
parent
commit
97679d6337
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  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