Skip to content

Commit

Permalink
refactor: improve name
Browse files Browse the repository at this point in the history
  • Loading branch information
SverreNystad committed Jul 17, 2024
1 parent 1ccf08c commit bfc51d8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/src/main/java/board/master/service/GameService.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ public class GameService {
private ScheduledExecutorService throttlingScheduler = Executors.newScheduledThreadPool(1);
private ScheduledExecutorService timeScheduler = Executors.newScheduledThreadPool(1);

/*
* Time to live for a game in minutes
*/
private static final long timeToLive = 1;
private static final long timeToLiveMinutes = 1;

/**
* Logic to handle game creation
Expand Down Expand Up @@ -138,7 +135,7 @@ public GameResponse botMove(String gameId) throws IllegalArgumentException, Ille
Future<GameResponse> future = throttlingScheduler.submit(botMoveTask);
try {
// Wait for the bot move to complete or timeout
return future.get(timeToLive, TimeUnit.MINUTES);
return future.get(timeToLiveMinutes, TimeUnit.MINUTES);
} catch (TimeoutException e) {
future.cancel(true);
throw new IllegalStateException("Bot move timed out");
Expand Down

0 comments on commit bfc51d8

Please sign in to comment.