I’m scheduling a job to run on an interval. I want it to run right away, then every minute after. I can see that the job is being scheduled, but it never runs. The “Next Run” time in “Scheduler details” shows the time the job was first scheduled, which is now in the past.
I’ve tried setting the first run time to one millisecond later now with no luck. I tried 10 seconds later and that worked, but I don’t know if it will always work. Also that’s just not a good workaround.
I am running 7.0 but have tested on 7.2 and 7.9 with the same results.
Here is my code:
JobConfig config = JobConfig.forJobRunnerKey(JOB_KEY)
.withSchedule(Schedule.forInterval(TimeUnit.MINUTES.toMillis(1), null));
try {
schedulerService.scheduleJob(JOB_ID, config);
} catch (SchedulerServiceException e) {
log.error("Error scheduling job", e);
}
Scheduler details (taken on Friday May 04 14:20):