Skip to content

Commit

Permalink
Hardcode reconnect every 2 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Walkyst committed Aug 11, 2022
1 parent 7c321c7 commit be44f4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ repositories {
ext {
//@formatter:off
gradleVersion = '6.1.1'
lavaplayerVersion = 'eb917ad9fc'
lavaplayerVersion = '47df2b1ca7'
javaWebSocketVersion = '1.5.1'
slf4jVersion = '1.7.25'
jsonOrgVersion = '20180130'
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/lavalink/client/io/LavalinkSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class LavalinkSocket extends ReusableWebSocket {
@Nullable
private RemoteStats stats;
long lastReconnectAttempt = 0;
private int reconnectsAttempted = 0;
private int reconnectsAttempted = 2;
@NonNull
private final URI remoteUri;
private final LavalinkRestClient restClient;
Expand Down Expand Up @@ -87,7 +87,6 @@ public LavalinkRestClient getRestClient() {
public void onOpen(ServerHandshake handshakeData) {
available = true;
lavalink.loadBalancer.onNodeConnect(this);
reconnectsAttempted = 0;
configureResuming();

boolean resumed = Objects.equals(handshakeData.getFieldValue("Session-Resumed"), "true");
Expand Down Expand Up @@ -265,7 +264,6 @@ public URI getRemoteUri() {

void attemptReconnect() {
lastReconnectAttempt = System.currentTimeMillis();
reconnectsAttempted++;
connect();
}

Expand Down

0 comments on commit be44f4a

Please sign in to comment.