Wait 1s before reconnect websocket.

This commit is contained in:
Marc Baloup 2023-03-23 18:53:32 +01:00
parent 544abd218c
commit cafb220768
1 changed files with 5 additions and 0 deletions

View File

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