From 6ca7070d40d179058e3dd806dac2247baa59a432 Mon Sep 17 00:00:00 2001 From: Oleg Kravchuk Date: Wed, 8 Nov 2023 21:53:54 +0200 Subject: [PATCH] Interval schedule should take start time from the request, should not set it to the current time of request execution. Signed-off-by: Oleg Kravchuk --- .../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