I run a sbt task. Normal scenario after it finishes, it should stop in the terminal. But the terminal is not waiting for next input meaning : my task keeps running. I assume some called threads were not exited after the task launched them.
How to exit clean and kill all processes started by the sbt task ? I could debug which service was not stopped but it will take a long time to figure out.
More details
In the build.sbt
lazy val refreshTranslations = taskKey[Unit]("blabla")
fullRunTask(refreshTranslations, Compile, "tasks.TranslationTask")
In the task
object TranslationTask {
def main(args: Array[String]): Unit = {
// background stuff with ActorSystem() , AhcWSClient()
Await.result(service.get, 20.seconds)
...
}
}