mirror of https://github.com/sbt/sbt.git
Shutdown background jobs when pressing ctrl+c
This commit is contained in:
parent
aae3dbd3b7
commit
9494033bd6
|
|
@ -531,6 +531,7 @@ object EvaluateTask {
|
|||
log.warn("Canceling execution...")
|
||||
RunningProcesses.killAll()
|
||||
ConcurrentRestrictions.cancelAll()
|
||||
DefaultBackgroundJobService.stop()
|
||||
shutdownImpl(true)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -508,6 +508,15 @@ private[sbt] object DefaultBackgroundJobService {
|
|||
backgroundJobServices.values.forEach(_.shutdown())
|
||||
backgroundJobServices.clear()
|
||||
}
|
||||
|
||||
private[sbt] def stop(): Unit = {
|
||||
backgroundJobServices
|
||||
.values()
|
||||
.forEach(jobService => {
|
||||
jobService.jobs.foreach(jobService.stop)
|
||||
})
|
||||
}
|
||||
|
||||
private[sbt] lazy val backgroundJobServiceSetting: Setting[_] =
|
||||
(GlobalScope / Keys.bgJobService) := {
|
||||
val path = (GlobalScope / sbt.Keys.bgJobServiceDirectory).value
|
||||
|
|
|
|||
Loading…
Reference in New Issue