From a7ab4c93c6d530a0f53f3f979df89fc06c42cf75 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Mon, 23 Jul 2012 02:29:18 +0200 Subject: [PATCH] fixed lastRequest update and cache hit count update --- .../sap/sailing/gwt/ui/server/LiveLeaderboardUpdater.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/LiveLeaderboardUpdater.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/LiveLeaderboardUpdater.java index f1a47d22179..8d0988d4572 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/LiveLeaderboardUpdater.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/LiveLeaderboardUpdater.java @@ -100,16 +100,19 @@ public class LiveLeaderboardUpdater implements Runnable { public LeaderboardDTO getLiveLeaderboard(Collection namesOfRaceColumnsForWhichToLoadLegDetails) throws NoWindException { final MillisecondsTimePoint now = MillisecondsTimePoint.now(); + TimePoint timePoint = now.minus(getLeaderboard().getDelayToLiveInMillis()); LeaderboardDTO result = null; synchronized (this) { if (columnNamesForWhichCurrentLiveLeaderboardHasTheDetails.containsAll(namesOfRaceColumnsForWhichToLoadLegDetails)) { result = currentLiveLeaderboard; - cacheHitCount++; + lastRequest = timePoint; + if (result != null) { + cacheHitCount++; + } } } if (result == null) { // current cache doesn't have the column details requested; re-calculate cacheMissCount++; - TimePoint timePoint = now.minus(getLeaderboard().getDelayToLiveInMillis()); result = sailingService.computeLeaderboardByName(leaderboardName, timePoint, namesOfRaceColumnsForWhichToLoadLegDetails, /* waitForLatestAnalyses */ false); updateRequestTimes(namesOfRaceColumnsForWhichToLoadLegDetails, result, timePoint);