diff options
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/CacheBase.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/CacheBase.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/CacheBase.java index 8b549800..ffc92d4e 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/CacheBase.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/CacheBase.java @@ -6,8 +6,6 @@ import java.util.concurrent.TimeUnit; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; -import org.openslx.util.QuickTimer; -import org.openslx.util.QuickTimer.Task; /** * Class that caches an instance of a given class for 10 minutes. @@ -49,9 +47,11 @@ public abstract class CacheBase<T> { if (doFetch) { // This invocation found latch == null, which means it is // responsible for triggering the actual update. - QuickTimer.scheduleOnce(new Task() { + // Do not use QuickTimer, as we might already be running in it + // and would only deadlock ourselves + new Thread(getClass().getSimpleName() + "-Update") { @Override - public void fire() { + public void run() { T freshInstance = null; try { freshInstance = getCallback(); @@ -68,7 +68,7 @@ public abstract class CacheBase<T> { localLatch.countDown(); } } - }); + }.start(); } // Now just wait for latch, regardless of whether we triggered the update or not boolean ok = false; |