-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(*): schedule an execution on a fixed date
- Loading branch information
1 parent
48b3f0b
commit 6166b47
Showing
30 changed files
with
905 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
core/src/main/java/io/kestra/core/models/triggers/RecoverMissedSchedules.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.kestra.core.models.triggers; | ||
|
||
public enum RecoverMissedSchedules { | ||
LAST, | ||
NONE, | ||
ALL | ||
} |
29 changes: 29 additions & 0 deletions
29
core/src/main/java/io/kestra/core/models/triggers/Schedulable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.kestra.core.models.triggers; | ||
|
||
import io.kestra.core.exceptions.IllegalVariableEvaluationException; | ||
import io.kestra.core.models.conditions.ConditionContext; | ||
import io.kestra.core.runners.RunContext; | ||
|
||
import java.time.ZonedDateTime; | ||
|
||
public interface Schedulable extends PollingTriggerInterface{ | ||
String PLUGIN_PROPERTY_RECOVER_MISSED_SCHEDULES = "recoverMissedSchedules"; | ||
|
||
/** | ||
* Compute the previous evaluation of a trigger. | ||
* This is used when a trigger misses some schedule to compute the next date to evaluate in the past. | ||
*/ | ||
ZonedDateTime previousEvaluationDate(ConditionContext conditionContext) throws IllegalVariableEvaluationException; | ||
|
||
RecoverMissedSchedules getRecoverMissedSchedules(); | ||
|
||
/** | ||
* Load the default RecoverMissedSchedules from plugin property, or else ALL. | ||
*/ | ||
default RecoverMissedSchedules defaultRecoverMissedSchedules(RunContext runContext) { | ||
return runContext | ||
.<String>pluginConfiguration(PLUGIN_PROPERTY_RECOVER_MISSED_SCHEDULES) | ||
.map(conf -> RecoverMissedSchedules.valueOf(conf)) | ||
.orElse(RecoverMissedSchedules.ALL); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.