Browse Source
Merge pull request #904 from colinin/fix-persistent-job-statsu
fix(background-tasks): fixed persistent jobs that could only run once.
pull/914/head
yx lin
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
1 deletions
-
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobCreator.cs
|
|
|
@ -138,13 +138,17 @@ public class QuartzJobCreator : IQuartzJobCreator, ISingletonDependency |
|
|
|
var scheduleBuilder = SimpleScheduleBuilder.Create(); |
|
|
|
// TODO: 不能用Quartz自带的重试机制
|
|
|
|
// scheduleBuilder.WithRepeatCount(maxCount);
|
|
|
|
if (job.JobType == JobType.Persistent) |
|
|
|
{ |
|
|
|
scheduleBuilder.WithRepeatCount(maxCount); |
|
|
|
} |
|
|
|
if (job.Interval > 0) |
|
|
|
{ |
|
|
|
scheduleBuilder.WithIntervalInSeconds(job.Interval); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
scheduleBuilder.WithIntervalInSeconds(1); |
|
|
|
scheduleBuilder.WithIntervalInSeconds(300); |
|
|
|
} |
|
|
|
|
|
|
|
triggerBuilder.WithSchedule(scheduleBuilder); |
|
|
|
|