Skip to content

Commit a662b56

Browse files
committed
fix
1 parent 8760c49 commit a662b56

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lts-core/src/main/java/com/github/ltsopensource/core/support/JobDomainConverter.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ public static JobPo convert(Job job) {
5353
// 设置JobType
5454
if (job.isCron()) {
5555
jobPo.setJobType(JobType.CRON);
56+
jobPo.setCronExpression(job.getCronExpression());
5657
} else if (job.isRepeatable()) {
58+
jobPo.setCronExpression(null);
59+
jobPo.setRepeatInterval(job.getRepeatInterval());
60+
jobPo.setInternalExtParam(Constants.FIRST_FIRE_TIME, String.valueOf(jobPo.getTriggerTime()));
5761
jobPo.setJobType(JobType.REPEAT);
5862
} else if (job.getTriggerTime() == null) {
5963
jobPo.setJobType(JobType.REAL_TIME);
@@ -63,7 +67,6 @@ public static JobPo convert(Job job) {
6367

6468
jobPo.setExtParams(job.getExtParams());
6569
jobPo.setNeedFeedback(job.isNeedFeedback());
66-
jobPo.setCronExpression(job.getCronExpression());
6770
jobPo.setMaxRetryTimes(job.getMaxRetryTimes());
6871
jobPo.setRelyOnPrevCycle(job.isRelyOnPrevCycle());
6972
jobPo.setRepeatCount(job.getRepeatCount());
@@ -74,11 +77,6 @@ public static JobPo convert(Job job) {
7477
jobPo.setTriggerTime(job.getTriggerTime());
7578
}
7679
}
77-
if (job.getRepeatCount() != 0) {
78-
jobPo.setCronExpression(null);
79-
jobPo.setRepeatInterval(job.getRepeatInterval());
80-
jobPo.setInternalExtParam(Constants.FIRST_FIRE_TIME, String.valueOf(jobPo.getTriggerTime()));
81-
}
8280
return jobPo;
8381
}
8482

0 commit comments

Comments
 (0)