mirror of https://github.com/sbt/sbt.git
When running a main method, if the user inputs ctrl+c then the `run` task will exit but the main method is not interrupted so it continues running even once sbt has returned to the shell. If the main method is a webserver, this prevents run from ever starting again on a fixed port. To fix this, we can modify the waitForTry method to stop the job if an exception is thrown (ctrl+c leads to an interrupted exception being thrown by waitFor). I rework the BackgroundJobService so that the default implementation of waitForTry is now usable and no longer needs to be overridden. The side effect of this change is that waitFor may now throw an exception. Within sbt, waitFor was only used in one place and I reworked it to use waitForTry instead. This could theoretically break a downstream user who relied on waitFor not throwing an exception but I suspect that there aren't many users of this api, if any at all. |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||