ForwardingService: let main() throw InterruptedException

This simplifies main() and increases readability.
This commit is contained in:
Sean Gilligan 2024-04-22 23:55:13 -07:00 committed by Andreas Schildbach
parent a224bbed81
commit cff6459b4e

View File

@ -56,7 +56,7 @@ public class ForwardingService implements Closeable {
* Run the forwarding service as a command line tool
* @param args See {@link #USAGE}
*/
public static void main(String[] args) {
public static void main(String[] args) throws InterruptedException {
// This line makes the log output more compact and easily read, especially when using the JDK log adapter.
BriefLogFormatter.init();
Context.propagate(new Context());
@ -70,9 +70,7 @@ public class ForwardingService implements Closeable {
try (ForwardingService forwardingService = new ForwardingService(args)) {
forwardingService.run();
// Wait for Control-C
try {
Thread.sleep(Long.MAX_VALUE);
} catch (InterruptedException ignored) {}
Thread.sleep(Long.MAX_VALUE);
}
}