diff --git a/app/src/main/java/fi/sundae/bot/Bot.java b/app/src/main/java/fi/sundae/bot/Bot.java index 8b3e0c9..49583d4 100644 --- a/app/src/main/java/fi/sundae/bot/Bot.java +++ b/app/src/main/java/fi/sundae/bot/Bot.java @@ -39,7 +39,7 @@ public Bot(String token, String ownerId, String channelId, String adminRoleId) { } private void scheduleMatchmaking(JDA jda) { - try (ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor()) { + ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); executor.scheduleAtFixedRate( () -> { List matches = MATCHMAKER.buildAllMatches(); @@ -48,6 +48,5 @@ private void scheduleMatchmaking(JDA jda) { 0, 5, TimeUnit.MINUTES); - } } }