summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java b/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java
index 01bf2fc..7e64926 100644
--- a/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java
+++ b/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java
@@ -56,6 +56,26 @@ public class ConnectionManager {
*/
private static final LinkedHashMap<Integer, JsonGroup> groupPool = new LinkedHashMap<Integer, JsonGroup>();
+ private static final Thread listUpdater;
+
+ static {
+ listUpdater = new Thread() {
+ @Override
+ public void run() {
+ for (;;) {
+ try {
+ Thread.sleep(120000);
+ updateList();
+ } catch (InterruptedException e) {
+ LOGGER.info("Stopping list fetch thread");
+ return;
+ }
+ }
+ }
+ };
+ listUpdater.setDaemon(true);
+ listUpdater.start();
+ }
public static JsonGroup getGroup(int id) {
synchronized (clientPool) {