diff options
-rw-r--r-- | src/main/java/org/openslx/taskmanager/tasks/WakeOnLan.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/taskmanager/tasks/WakeOnLan.java b/src/main/java/org/openslx/taskmanager/tasks/WakeOnLan.java index bd9693c..2d07db9 100644 --- a/src/main/java/org/openslx/taskmanager/tasks/WakeOnLan.java +++ b/src/main/java/org/openslx/taskmanager/tasks/WakeOnLan.java @@ -12,6 +12,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; import org.apache.logging.log4j.util.Strings; import org.openslx.satserver.util.MessageSink; @@ -175,6 +176,12 @@ public class WakeOnLan extends AbstractTask } } } while ( true ); + tp.shutdown(); + try { + tp.awaitTermination( 10, TimeUnit.SECONDS ); + } catch ( InterruptedException e ) { + Thread.currentThread().interrupt(); + } status.addMsg( "Mainloop done" ); if ( this.clients.isEmpty() ) return true; |