Clarified that CronTrigger never schedules overlapping executions
Issue: SPR-10556
This commit is contained in:
parent
278a5924cb
commit
5dbbd8fe72
|
@ -16,12 +16,12 @@
|
||||||
|
|
||||||
package org.springframework.scheduling.support;
|
package org.springframework.scheduling.support;
|
||||||
|
|
||||||
import org.springframework.scheduling.Trigger;
|
|
||||||
import org.springframework.scheduling.TriggerContext;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
import org.springframework.scheduling.Trigger;
|
||||||
|
import org.springframework.scheduling.TriggerContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link Trigger} implementation for cron expressions.
|
* {@link Trigger} implementation for cron expressions.
|
||||||
* Wraps a {@link CronSequenceGenerator}.
|
* Wraps a {@link CronSequenceGenerator}.
|
||||||
|
@ -55,6 +55,12 @@ public class CronTrigger implements Trigger {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the next execution time according to the given trigger context.
|
||||||
|
* <p>Next execution times are calculated based on the
|
||||||
|
* {@linkplain TriggerContext#lastCompletionTime completion time} of the
|
||||||
|
* previous execution; therefore, overlapping executions won't occur.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Date nextExecutionTime(TriggerContext triggerContext) {
|
public Date nextExecutionTime(TriggerContext triggerContext) {
|
||||||
Date date = triggerContext.lastCompletionTime();
|
Date date = triggerContext.lastCompletionTime();
|
||||||
|
|
Loading…
Reference in New Issue