Reapply "Adding concurrency support to some lines which are causing issues on production"
This reverts commit f9dd9d0962.
This commit is contained in:
@@ -27,6 +27,7 @@ import java.time.Duration;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class TournamentService {
|
||||
private final ProductLibrary _productLibrary;
|
||||
@@ -47,8 +48,8 @@ public class TournamentService {
|
||||
private static final Duration _tournamentRepeatPeriod = Duration.ofDays(2);
|
||||
private static final int _scheduledTournamentLoadTime = 7; // In days; one week
|
||||
|
||||
private final Map<String, Tournament> _activeTournaments = new LinkedHashMap<>();
|
||||
private final Map<String, TournamentQueue> _tournamentQueues = new LinkedHashMap<>();
|
||||
private final Map<String, Tournament> _activeTournaments = new ConcurrentHashMap<>();
|
||||
private final Map<String, TournamentQueue> _tournamentQueues = new ConcurrentHashMap<>();
|
||||
|
||||
public TournamentService(CollectionsManager collectionsManager, ProductLibrary productLibrary, DraftPackStorage draftPackStorage,
|
||||
TournamentDAO tournamentDao, TournamentPlayerDAO tournamentPlayerDao, TournamentMatchDAO tournamentMatchDao,
|
||||
@@ -487,7 +488,7 @@ public class TournamentService {
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<Tournament> getLiveTournaments() {
|
||||
public synchronized List<Tournament> getLiveTournaments() {
|
||||
return new ArrayList<>(_activeTournaments.values());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user