Destroy headless process if it goes too long
Former-commit-id: 995e9805a2
Former-commit-id: 6e9354a9e8bff60e65764aabef0fc33d93cdc9f8
This commit is contained in:
@ -4,6 +4,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* I2PFirefox.java
|
||||
@ -508,13 +509,15 @@ public class I2PFirefox extends I2PCommonBrowser {
|
||||
try {
|
||||
Process hp = hpb.start();
|
||||
try {
|
||||
int hev = hp.waitFor();
|
||||
boolean hev = hp.waitFor(20, TimeUnit.SECONDS);
|
||||
if (!hev)
|
||||
hp.destroy();
|
||||
println("Headless browser run completed, exit: " + hev);
|
||||
} catch (InterruptedException e) {
|
||||
println(e.toString());
|
||||
println("Headless browser error "+e.toString());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
println(e.toString());
|
||||
println("Headless browser error "+e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user