From 5459dd43516d67c261da5b11996d03204d2ace41 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 10:14:54 -0800 Subject: [PATCH] Interval schedule should take start time from the request, should not set it to the current time of request execution. (#1036) (#1038) (cherry picked from commit 6810b0cee4dd48ca7ee2f40916ca21d2ebefc00b) Signed-off-by: Oleg Kravchuk Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../org/opensearch/indexmanagement/transform/model/Transform.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt index 1403639af..db3145e08 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt @@ -387,7 +387,7 @@ data class Transform( if (seqNo == SequenceNumbers.UNASSIGNED_SEQ_NO || primaryTerm == SequenceNumbers.UNASSIGNED_PRIMARY_TERM) { // we instantiate the start time if (schedule is IntervalSchedule) { - schedule = IntervalSchedule(Instant.now(), schedule.interval, schedule.unit) + schedule = IntervalSchedule(schedule.startTime, schedule.interval, schedule.unit) } // we clear out metadata if its a new job