Skip to content

Commit 5dbbd8f

Browse files
committed
Clarified that CronTrigger never schedules overlapping executions
Issue: SPR-10556
1 parent 278a592 commit 5dbbd8f

File tree

1 file changed

+9
-3
lines changed
  • spring-context/src/main/java/org/springframework/scheduling/support

1 file changed

+9
-3
lines changed

spring-context/src/main/java/org/springframework/scheduling/support/CronTrigger.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
package org.springframework.scheduling.support;
1818

19-
import org.springframework.scheduling.Trigger;
20-
import org.springframework.scheduling.TriggerContext;
21-
2219
import java.util.Date;
2320
import java.util.TimeZone;
2421

22+
import org.springframework.scheduling.Trigger;
23+
import org.springframework.scheduling.TriggerContext;
24+
2525
/**
2626
* {@link Trigger} implementation for cron expressions.
2727
* Wraps a {@link CronSequenceGenerator}.
@@ -55,6 +55,12 @@ public CronTrigger(String cronExpression, TimeZone timeZone) {
5555
}
5656

5757

58+
/**
59+
* Determine the next execution time according to the given trigger context.
60+
* <p>Next execution times are calculated based on the
61+
* {@linkplain TriggerContext#lastCompletionTime completion time} of the
62+
* previous execution; therefore, overlapping executions won't occur.
63+
*/
5864
@Override
5965
public Date nextExecutionTime(TriggerContext triggerContext) {
6066
Date date = triggerContext.lastCompletionTime();

0 commit comments

Comments
 (0)