Skip to content

Commit

Permalink
start_time npe fix for Rollup and Transform jobs (#1164)
Browse files Browse the repository at this point in the history
(cherry picked from commit ffabd86)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed May 2, 2024
1 parent 2b2d99c commit faa96b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,10 @@ data class Rollup(
// TODO: Make startTime public in Job Scheduler so we can just directly check the value
if (seqNo == SequenceNumbers.UNASSIGNED_SEQ_NO || primaryTerm == SequenceNumbers.UNASSIGNED_PRIMARY_TERM) {
if (schedule is IntervalSchedule) {
schedule = IntervalSchedule(schedule.startTime, schedule.interval, schedule.unit, schedule.delay ?: 0)
schedule = IntervalSchedule(schedule.startTime ?: Instant.now(), schedule.interval, schedule.unit, schedule.delay ?: 0)
}
}

return Rollup(
id = id,
seqNo = seqNo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,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(schedule.startTime, schedule.interval, schedule.unit)
schedule = IntervalSchedule(schedule.startTime ?: Instant.now(), schedule.interval, schedule.unit)
}

// we clear out metadata if its a new job
Expand Down

0 comments on commit faa96b2

Please sign in to comment.