Wait 1s before reconnect websocket.

This commit is contained in:
Marc Baloup 2023-03-23 18:53:32 +01:00
parent 544abd218c
commit cafb220768

View File

@ -106,6 +106,11 @@ public abstract class AbstractClientWS implements AbstractWS {
private void reconnectIfNecessary() { private void reconnectIfNecessary() {
synchronized (socket) { synchronized (socket) {
if (autoReconnect && !isConnecting && socket.get() == null) { if (autoReconnect && !isConnecting && socket.get() == null) {
try {
Thread.sleep(1000);
} catch (InterruptedException ignored) {
Thread.currentThread().interrupt();
}
connect(); connect();
} }
} }