Skip to content

Commit

Permalink
Dedup ScheduleStream by jobName. (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
debugger87 authored and brndnmtthws committed Jun 21, 2016
1 parent 2f12dcd commit ce4469d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,13 @@ class JobScheduler @Inject()(val scheduleHorizon: Period,
log.info("Adding schedule for time:" + now.toString(DateTimeFormat.fullTime()))
lock.synchronized {
log.fine("Starting iteration")
streams = iteration(now, newStreams ++ streams)
for(stream <- newStreams) {
if (!streams.exists(_.jobName == stream.jobName)) {
streams = streams :+ stream
}
}

streams = iteration(now, streams)
log.fine("Size of streams: %d".format(streams.size))
}
}
Expand Down

0 comments on commit ce4469d

Please # to comment.