Update to 19008 and tweak game round cleanup

This commit is contained in:
Andrew Guibert 2019-09-11 12:00:05 -05:00
parent 3d4eed8f52
commit 432a190beb
2 changed files with 5 additions and 5 deletions

View File

@ -71,7 +71,7 @@ subprojects {
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.eclipse', name: 'yasson', version: '1.0.3'
testCompile group: 'org.glassfish', name: 'jakarta.json', version: '1.1.5'
libertyRuntime group: 'io.openliberty', name: 'openliberty-runtime', version: '[19.0.0.5,)'
libertyRuntime group: 'io.openliberty', name: 'openliberty-runtime', version: '[19.0.0.8,)'
}
eclipse {

View File

@ -40,7 +40,7 @@ public class GameRoundService {
GameRound p = new GameRound();
allRounds.put(p.id, p);
System.out.println("Created round id=" + p.id);
if (allRounds.size() > 5)
if (allRounds.size() > 35)
System.out.println("WARNING: Found " + allRounds.size() + " active games in GameRoundService. " +
"They are probably not being cleaned up properly: " + allRounds.keySet());
return p.id;
@ -50,7 +50,7 @@ public class GameRoundService {
public GameRound createRoundById(@QueryParam("gameId") String gameId) {
GameRound round = allRounds.computeIfAbsent(gameId, k -> new GameRound(gameId));
System.out.println("Created round id=" + round.id);
if (allRounds.size() > 5)
if (allRounds.size() > 35)
System.out.println("WARNING: Found " + allRounds.size() + " active games in GameRoundService. " +
"They are probably not being cleaned up properly: " + allRounds.keySet());
return round;
@ -101,12 +101,12 @@ public class GameRoundService {
String roundId = round.id;
if (round.isOpen())
round.gameState = State.FINISHED;
System.out.println("Scheduling round id=" + roundId + " for deletion in 5 minutes");
System.out.println("Scheduling round id=" + roundId + " for deletion in 15 minutes");
// Do not immediately delete rounds in order to give players/spectators time to move along to the next game
exec.schedule(() -> {
allRounds.remove(roundId);
System.out.println("Deleted round id=" + roundId);
}, 5, TimeUnit.MINUTES);
}, 15, TimeUnit.MINUTES);
}
}