mirror of
https://github.com/DerDavidBohl/dirigent-spring.git
synced 2026-01-07 16:17:09 -06:00
Refactor ProcessRunner to use Duration for wait time in process termination
This commit is contained in:
@@ -6,6 +6,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -131,7 +132,7 @@ public class ProcessRunner {
|
||||
log.debug("Killing child process: {}", child.pid());
|
||||
child.destroyForcibly();
|
||||
try {
|
||||
child.waitFor(2, TimeUnit.SECONDS);
|
||||
child.wait(Duration.ofSeconds(2).toMillis());
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user