mirror of https://github.com/sbt/sbt.git
Merge branch 'develop' into bsp-consolidate
This commit is contained in:
commit
8ee28d5693
|
|
@ -179,11 +179,15 @@ private[sbt] abstract class AbstractBackgroundJobService extends BackgroundJobSe
|
||||||
|
|
||||||
override final def close(): Unit = shutdown()
|
override final def close(): Unit = shutdown()
|
||||||
override def shutdown(): Unit = {
|
override def shutdown(): Unit = {
|
||||||
while (jobSet.nonEmpty) {
|
val deadline = 10.seconds.fromNow
|
||||||
|
while (jobSet.nonEmpty && !deadline.isOverdue) {
|
||||||
jobSet.headOption.foreach {
|
jobSet.headOption.foreach {
|
||||||
case handle: ThreadJobHandle @unchecked =>
|
case handle: ThreadJobHandle @unchecked =>
|
||||||
handle.job.shutdown()
|
if (handle.job.isRunning) {
|
||||||
handle.job.awaitTerminationTry(10.seconds)
|
handle.job.shutdown()
|
||||||
|
handle.job.awaitTerminationTry(10.seconds)
|
||||||
|
}
|
||||||
|
jobSet = jobSet - handle
|
||||||
case _ => //
|
case _ => //
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue