Skip to content

Commit

Permalink
Revert "#110 | Setup First Run to run now on Misfire with start time …
Browse files Browse the repository at this point in the history
…in past"

This reverts commit f50bed2.
  • Loading branch information
himeshr committed Jan 6, 2025
1 parent 29f3596 commit b0a73a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ private Trigger getHigherPriorityTriggerForFirstRun(JobScheduleRequest jobSchedu
Trigger trigger = newTrigger()
.withIdentity(scheduledJobConfig.getTriggerKey(jobScheduleRequest.getEntityUUID() + "run1", jobScheduleRequest.getJobGroup()))
.forJob(jobDetail)
.withSchedule(simpleSchedule().withMisfireHandlingInstructionFireNow())
.startAt(DateTimeUtil.nowMinusMinutes(scheduledJobConfig.getSyncRepeatIntervalInMinutes()))
.startAt(DateTimeUtil.nowPlusSeconds(5))
.withPriority(6) //higher than default (5)
.build();
return trigger;
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/avniproject/etl/util/DateTimeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@ public static Date nowPlusSeconds(int numberOfSeconds) {
Date startTime = new Date();
return new Date(startTime.getTime() + numberOfSeconds * 1000L);
}
public static Date nowMinusMinutes(int numberOfMinutes) {
Date startTime = new Date();
return new Date(startTime.getTime() - numberOfMinutes * 60 * 1000L);
}
}

0 comments on commit b0a73a2

Please sign in to comment.