fix autocloseable executors
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -187,8 +187,10 @@ public class HidekoBot
|
||||
|
||||
// update slash commands (delayed)
|
||||
final boolean finalForceUpdateCommands = forceUpdateCommands;
|
||||
Executors.newSingleThreadScheduledExecutor().schedule(() -> // todo: try-with-resources
|
||||
CommandUtil.updateSlashCommands(finalForceUpdateCommands), 1, TimeUnit.SECONDS);
|
||||
try (ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor()) {
|
||||
executor.schedule(() -> CommandUtil.updateSlashCommands(finalForceUpdateCommands),
|
||||
1, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
// set the bot's status
|
||||
jda.getPresence().setStatus(OnlineStatus.ONLINE);
|
||||
|
Reference in New Issue
Block a user