mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-20 11:10:00 +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 {
|
throws NoWindException, InterruptedException, ExecutionException {
|
||||||
Triple<String, Date, Collection<String>> key = new Triple<String, Date, Collection<String>>(
|
Triple<String, Date, Collection<String>> key = new Triple<String, Date, Collection<String>>(
|
||||||
leaderboardName, date, namesOfRaceColumnsForWhichToLoadLegDetails);
|
leaderboardName, date, namesOfRaceColumnsForWhichToLoadLegDetails);
|
||||||
FutureTask<LeaderboardDTO> future;
|
FutureTask<LeaderboardDTO> future = null;
|
||||||
boolean cacheHit = false;
|
boolean cacheHit = false;
|
||||||
synchronized (leaderboardByNameCache) {
|
synchronized (leaderboardByNameCache) {
|
||||||
future = leaderboardByNameCache.get(key);
|
if (!waitForLatestAnalyses) {
|
||||||
|
future = leaderboardByNameCache.get(key);
|
||||||
|
}
|
||||||
if (future == null) {
|
if (future == null) {
|
||||||
future = new FutureTask<LeaderboardDTO>(new Callable<LeaderboardDTO>() {
|
future = new FutureTask<LeaderboardDTO>(new Callable<LeaderboardDTO>() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in new issue
Block a user