mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-19 02:29:58 +00:00
use cache only if not waiting for latest analyses
This commit is contained in:
1 parent
bafab3a7a0
commit
7bc53ef5d1
1 file changed
+4
-2
+4
-2
@@ -373,10 +373,12 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
|
||||
throws NoWindException, InterruptedException, ExecutionException {
|
||||
Triple<String, Date, Collection<String>> key = new Triple<String, Date, Collection<String>>(
|
||||
leaderboardName, date, namesOfRaceColumnsForWhichToLoadLegDetails);
|
||||
FutureTask<LeaderboardDTO> future;
|
||||
FutureTask<LeaderboardDTO> future = null;
|
||||
boolean cacheHit = false;
|
||||
synchronized (leaderboardByNameCache) {
|
||||
future = leaderboardByNameCache.get(key);
|
||||
if (!waitForLatestAnalyses) {
|
||||
future = leaderboardByNameCache.get(key);
|
||||
}
|
||||
if (future == null) {
|
||||
future = new FutureTask<LeaderboardDTO>(new Callable<LeaderboardDTO>() {
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user