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.
This commit is contained in:
Ethan Atkins 2020-09-23 12:07:56 -07:00
parent 7956528f25
commit 4ec6339794
1 changed files with 3 additions and 2 deletions

View File

@ -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 {