mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-19 07:15:54 -04:00
add timeout to shutdown handler, change timout for btc network connection lost
This commit is contained in:
parent
a57f246a0c
commit
a0e7a80bfc
@ -68,6 +68,7 @@ import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -280,7 +281,12 @@ public class WalletService {
|
||||
wallet.removeEventListener(walletEventListener);
|
||||
if (walletAppKit != null) {
|
||||
walletAppKit.stopAsync();
|
||||
walletAppKit.awaitTerminated();
|
||||
try {
|
||||
walletAppKit.awaitTerminated(5, TimeUnit.SECONDS);
|
||||
} catch (TimeoutException e) {
|
||||
e.printStackTrace();
|
||||
log.error("walletAppKit.awaitTerminated not terminated after 5 sec. Error message: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ public final class Node {
|
||||
public String toString() {
|
||||
return "Name='" + name + '\'' +
|
||||
"; IP='" + ip + '\'' +
|
||||
"; P2P network ID=" + p2pId +
|
||||
"; port=" + port;
|
||||
"; port=" + port +
|
||||
"; P2P network ID=" + p2pId;
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ class MainViewModel implements ViewModel {
|
||||
|
||||
private static final long BLOCKCHAIN_SYNC_TIMEOUT = 60000;
|
||||
private static final long LOST_P2P_CONNECTION_TIMEOUT = 5000;
|
||||
private static final long LOST_BTC_CONNECTION_TIMEOUT = 2000;
|
||||
private static final long LOST_BTC_CONNECTION_TIMEOUT = 5000;
|
||||
|
||||
private final User user;
|
||||
private final KeyRing keyRing;
|
||||
|
@ -150,7 +150,7 @@ public class NetworkSettingsView extends InitializableView {
|
||||
});
|
||||
|
||||
Action response = Popups.openConfirmPopup("Info", "You need to restart the application to apply the change of the Bitcoin network.",
|
||||
"Do you want to shutdown now?", actions);
|
||||
"Do you want to restart now?", actions);
|
||||
|
||||
if (Popups.isYes(response))
|
||||
BitsquareApp.restartDownHandler.run();
|
||||
|
Loading…
x
Reference in New Issue
Block a user