From 03caff346a52d199be32e8a89d35b461c37ceb87 Mon Sep 17 00:00:00 2001 From: Vincent Guerci Date: Wed, 27 Sep 2017 15:51:58 +0200 Subject: [PATCH] Callback leak fix --- .../criteo/cuttle/timeseries/TimeSeriesScheduler.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/timeseries/src/main/scala/com/criteo/cuttle/timeseries/TimeSeriesScheduler.scala b/timeseries/src/main/scala/com/criteo/cuttle/timeseries/TimeSeriesScheduler.scala index 58bd83423..a995e75cb 100644 --- a/timeseries/src/main/scala/com/criteo/cuttle/timeseries/TimeSeriesScheduler.scala +++ b/timeseries/src/main/scala/com/criteo/cuttle/timeseries/TimeSeriesScheduler.scala @@ -346,11 +346,9 @@ case class TimeSeriesScheduler(logger: Logger) extends Scheduler[TimeSeries] wit (execution.job, execution.context, result) } - Future.firstCompletedOf( - utils.Timeout(ScalaDuration.create(1, "s")) :: newRunning.map(_._3).toList) - .andThen { - case _ => mainLoop(newRunning ++ stillRunning) - } + utils.Timeout(ScalaDuration.create(1, "s")).andThen { + case _ => mainLoop(newRunning) + } } mainLoop(Set.empty)