mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-06-26 14:44:46 +02:00
Updating logs to provide correct time before reconnecting
This commit is contained in:
parent
3e9f6bdd3d
commit
47bfad2c50
|
@ -377,7 +377,7 @@ public final class SubDataClient {
|
||||||
log.info.println("The SubData Connection was closed");
|
log.info.println("The SubData Connection was closed");
|
||||||
int reconnectDelay = host.config.get().getSection("Settings").getSection("SubData").getInt("Reconnect delay", 30);
|
int reconnectDelay = host.config.get().getSection("Settings").getSection("SubData").getInt("Reconnect delay", 30);
|
||||||
if (reconnect) {
|
if (reconnect) {
|
||||||
log.info.println("Attempting to reconnect in 30 seconds");
|
log.info.println("Attempting to reconnect in " + reconnectDelay + " seconds");
|
||||||
Timer timer = new Timer();
|
Timer timer = new Timer();
|
||||||
timer.scheduleAtFixedRate(new TimerTask() {
|
timer.scheduleAtFixedRate(new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -390,7 +390,7 @@ public final class SubDataClient {
|
||||||
queue.remove(0);
|
queue.remove(0);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.warn.println("Connection was unsuccessful, retrying in 30 seconds");
|
log.warn.println("Connection was unsuccessful, retrying in " + reconnectDelay + " seconds");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, TimeUnit.SECONDS.toMillis(reconnectDelay), TimeUnit.SECONDS.toMillis(reconnectDelay));
|
}, TimeUnit.SECONDS.toMillis(reconnectDelay), TimeUnit.SECONDS.toMillis(reconnectDelay));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user