Increased registry update frequency.
This commit is contained in:
parent
e38ae65ff9
commit
c10dd7cd02
|
@ -26,8 +26,8 @@ import java.util.stream.Stream;
|
|||
public class ServerRegistry {
|
||||
private static final Logger log = LoggerFactory.getLogger(ServerRegistry.class);
|
||||
|
||||
public static final Duration SERVER_TIMEOUT = Duration.ofMinutes(5);
|
||||
public static final Duration SERVER_MIN_UPDATE = Duration.ofMinutes(1);
|
||||
public static final Duration SERVER_TIMEOUT = Duration.ofMinutes(3);
|
||||
public static final Duration SERVER_MIN_UPDATE = Duration.ofSeconds(5);
|
||||
|
||||
private final Map<ServerIdentifier, ServerInfo> servers = new ConcurrentHashMap<>();
|
||||
private final ServerInfoValidator infoValidator = new ServerInfoValidator();
|
||||
|
|
|
@ -88,7 +88,7 @@ public class Server implements Runnable {
|
|||
new Thread(worldUpdater).start();
|
||||
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
|
||||
var registryUpdater = new RegistryUpdater(this);
|
||||
executorService.scheduleAtFixedRate(registryUpdater::sendUpdates, 0, 90, TimeUnit.SECONDS);
|
||||
executorService.scheduleAtFixedRate(registryUpdater::sendUpdates, 0, 30, TimeUnit.SECONDS);
|
||||
System.out.printf("Started AoS2 Server on TCP/UDP port %d; now accepting connections.%n", serverSocket.getLocalPort());
|
||||
while (running) {
|
||||
acceptClientConnection();
|
||||
|
|
Loading…
Reference in New Issue