Configurable version update interval

This commit is contained in:
Sotr
2018-06-24 21:04:36 +08:00
parent 4c622207e1
commit 8a6c36ab2c
2 changed files with 6 additions and 1 deletions

View File

@@ -269,4 +269,9 @@ public class AkarinGlobalConfig {
private static void playersInfoUpdateInterval() {
playersInfoUpdateInterval = getSeconds(getString("core.tick-rate.players-info-update-interval", "30s")) * 10;
}
public static long versionUpdateInterval;
private static void versionUpdateInterval() {
versionUpdateInterval = getSeconds(getString("alternative.version-update-interval", "3600s")) * 1000; // 1 hour
}
}

View File

@@ -70,7 +70,7 @@ public abstract class MixinVersionCommand {
if (hasVersion) {
long current = System.currentTimeMillis();
if (current - lastCheckMillis > 7200000 /* 2 hours */) {
if (current - lastCheckMillis > AkarinGlobalConfig.versionUpdateInterval) {
lastCheckMillis = current;
hasVersion = false;
} else {