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
  • Loading branch information
ikibo authored May 2, 2024
1 parent 0ad084d commit ffabd86
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 @@ -340,9 +340,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 @@ -397,7 +397,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 ffabd86

Please sign in to comment.