'How can I add some minutes to an existing CronExpression
I am looking for a way to calculate a new CronExpression from an existing one by adding for example 10 minutes.
I need this because we generate several jobs from a single job definition. This job definition contains only 1 cron expression which is manually added by a user. The job definition also contains a list of id's (it can have a size from 1 up to about 80) and our Java code generates a job for each id in this list. Each generated job uses a copy of the original cron expression, so we end up with at most 80 generated jobs with the same cron expression. This means all these jobs will start at the same moment in time. I am looking for a way to spread this.
So I was thinking of something like this:
CronExpression cronExpression = new CronExpression("0 0 5 * * ?");
CronExpression newCronExpression = cronExpression.addMinutes(10);
But as far as I can see the cronExpression class (org.quartz-scheduler:quartz:2.3.0) does not support this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
