From 9ee1999becd03aa360dc7c31a375813325e573a4 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 27 Apr 2024 08:49:17 +0100 Subject: [PATCH] fix last seen --- src/main/java/cc/fascinated/piaservers/model/PiaServer.java | 3 ++- src/main/java/cc/fascinated/piaservers/pia/PiaManager.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/cc/fascinated/piaservers/model/PiaServer.java b/src/main/java/cc/fascinated/piaservers/model/PiaServer.java index 21c015a..ced261d 100644 --- a/src/main/java/cc/fascinated/piaservers/model/PiaServer.java +++ b/src/main/java/cc/fascinated/piaservers/model/PiaServer.java @@ -2,10 +2,11 @@ package cc.fascinated.piaservers.model; import lombok.AllArgsConstructor; import lombok.Getter; +import lombok.Setter; import java.util.Date; -@AllArgsConstructor @Getter +@AllArgsConstructor @Getter @Setter public class PiaServer { /** * The IP of this server. diff --git a/src/main/java/cc/fascinated/piaservers/pia/PiaManager.java b/src/main/java/cc/fascinated/piaservers/pia/PiaManager.java index d6421ff..0b27c46 100644 --- a/src/main/java/cc/fascinated/piaservers/pia/PiaManager.java +++ b/src/main/java/cc/fascinated/piaservers/pia/PiaManager.java @@ -55,6 +55,11 @@ public class PiaManager { SERVERS.removeAll(toRemove); // Remove the servers System.out.printf("Removed %s old servers\n", toRemove.size()); + // Update the last seen time for all the servers + for (PiaServer server : SERVERS) { + server.setLastSeen(new Date()); + } + // Add the new servers to the list for (PiaServerToken serverToken : piaDomain) { InetAddress address = InetAddress.getByName(serverToken.getHostname());