From 868a18188a40d18cd8209b6a231c7e1fd3ed62c3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 22 Jan 2024 13:54:08 +0100 Subject: [server] "using old data" message is confusing, only show if >= 1d --- .../src/main/java/org/openslx/bwlp/sat/thrift/cache/CacheBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 ffc92d4e..8b701111 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 @@ -79,8 +79,8 @@ public abstract class CacheBase { ok = localLatch.await(waitTime, TimeUnit.SECONDS); } catch (InterruptedException e) { } - if (!ok) { - LOGGER.warn("CacheUpdate for " + getClass().getSimpleName() + " timed out, using old data."); + if (!ok && (System.currentTimeMillis() - cacheTimeout) > 86400_000) { + LOGGER.warn("CacheUpdate for " + getClass().getSimpleName() + " timed out, using old data from >= 1 day ago."); } synchronized (this) { return cachedInstance; -- cgit v1.2.3-55-g7522