fix new server count
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s

This commit is contained in:
Lee 2024-04-29 07:09:19 +01:00
parent 2a47e9eca9
commit 9babf45272

@ -85,7 +85,8 @@ public class PiaManager {
// Add the server to the list // Add the server to the list
PiaServer server = new PiaServer(serverToken.getIp(), serverToken.getRegion(), new Date()); PiaServer server = new PiaServer(serverToken.getIp(), serverToken.getRegion(), new Date());
SERVERS.add(server); SERVERS.add(server);
if (!SERVERS.contains(server)) { boolean newServer = SERVERS.stream().noneMatch(s -> s.getIp().equals(server.getIp()));
if (newServer) {
newServers++; newServers++;
} }
} }