Skip to content

Commit

Permalink
remove 6hr reconnect
Browse files Browse the repository at this point in the history
2b2t just removed the 6hr kick
  • Loading branch information
odpay committed Aug 17, 2023
1 parent 9fb07f6 commit 6a0e562
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions src/main/java/com/zenith/Proxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,22 @@ public void start() {
SCHEDULED_EXECUTOR_SERVICE.scheduleAtFixedRate(this::handleActiveHoursTick, 1L, 1L, TimeUnit.MINUTES);
// health check on proxy server state.
SCHEDULED_EXECUTOR_SERVICE.scheduleAtFixedRate(this::serverHealthCheck, 5L, 5L, TimeUnit.MINUTES);
if (CONFIG.client.extra.sixHourReconnect) {
SCHEDULED_EXECUTOR_SERVICE.scheduleAtFixedRate(() -> {
try {
if (isOnlineOn2b2tForAtLeastDuration(Duration.ofSeconds(60))) {
long onlineSeconds = Instant.now().getEpochSecond() - connectTime.getEpochSecond();
if (onlineSeconds > (21600 - (60 + ThreadLocalRandom.current().nextInt(120)))) { // 6 hrs - 60 seconds padding
this.disconnect(SYSTEM_DISCONNECT);
this.cancelAutoReconnect();
this.connect();
}
}
} catch (final Throwable e) {
DEFAULT_LOG.error("Error in reconnect executor service", e);
}
}, 0, 10L, TimeUnit.SECONDS);
}
// if (CONFIG.client.extra.sixHourReconnect) {
// SCHEDULED_EXECUTOR_SERVICE.scheduleAtFixedRate(() -> {
// try {
// if (isOnlineOn2b2tForAtLeastDuration(Duration.ofSeconds(60))) {
// long onlineSeconds = Instant.now().getEpochSecond() - connectTime.getEpochSecond();
// if (onlineSeconds > (21600 - (60 + ThreadLocalRandom.current().nextInt(120)))) { // 6 hrs - 60 seconds padding
// this.disconnect(SYSTEM_DISCONNECT);
// this.cancelAutoReconnect();
// this.connect();
// }
// }
// } catch (final Throwable e) {
// DEFAULT_LOG.error("Error in reconnect executor service", e);
// }
// }, 0, 10L, TimeUnit.SECONDS);
// }
if (CONFIG.client.extra.twentyMinuteReconnectIfStuck) {
SCHEDULED_EXECUTOR_SERVICE.scheduleAtFixedRate(() -> {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/zenith/util/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static final class Extra {
public List<WhitelistEntry> friendsList = new ArrayList<>();
public boolean clientConnectionMessages = true;
public boolean autoConnectOnLogin = true;
public boolean sixHourReconnect = true;
// public boolean sixHourReconnect = false;
public boolean twentyMinuteReconnectIfStuck = true;
public boolean prioBan2b2tCheck = true;
public boolean prioStatusChangeMention = true;
Expand Down

0 comments on commit 6a0e562

Please sign in to comment.