From 4ec6339794c2d72eb02527b769b8f3972719cb5b Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Wed, 23 Sep 2020 12:07:56 -0700 Subject: [PATCH] Fix logical bug in task report scheduling The conditional for whether to make task progress events repeatable was inverted. This wasn't actually noticeable because the function doReport() was being schedule which had a guard to prevent it from running more frequently than the report period. --- main/src/main/scala/sbt/internal/TaskProgress.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/src/main/scala/sbt/internal/TaskProgress.scala b/main/src/main/scala/sbt/internal/TaskProgress.scala index 4234daf1b..ccb3c2eda 100644 --- a/main/src/main/scala/sbt/internal/TaskProgress.scala +++ b/main/src/main/scala/sbt/internal/TaskProgress.scala @@ -48,8 +48,9 @@ private[sbt] class TaskProgress( val delay = duration.toMillis try { val future = - if (recurring) scheduler.schedule(runnable, delay, TimeUnit.MILLISECONDS) - else scheduler.scheduleAtFixedRate(runnable, delay, delay, TimeUnit.MILLISECONDS) + if (recurring) + scheduler.scheduleAtFixedRate(runnable, delay, delay, TimeUnit.MILLISECONDS) + else scheduler.schedule(runnable, delay, TimeUnit.MILLISECONDS) pending.add(future) () => Util.ignoreResult(future.cancel(true)) } catch {