mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Properly close DB objects once PP migration is complete
This commit is contained in:
parent
f7baf67985
commit
cd9f18ffdb
@ -111,7 +111,7 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
|
||||
// Find a list of UUIDs
|
||||
log.info("PowerfulPerms Migration: Getting a list of UUIDs to migrate.");
|
||||
|
||||
HikariDataSource hikari = new HikariDataSource();
|
||||
@Cleanup HikariDataSource hikari = new HikariDataSource();
|
||||
hikari.setMaximumPoolSize(2);
|
||||
hikari.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
|
||||
hikari.addDataSourceProperty("serverName", address.split(":")[0]);
|
||||
@ -133,7 +133,7 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
|
||||
|
||||
} else {
|
||||
@Cleanup PreparedStatement preparedStatement = connection.prepareStatement("SELECT `uuid` FROM " + dbTable);
|
||||
ResultSet resultSet = preparedStatement.executeQuery();
|
||||
@Cleanup ResultSet resultSet = preparedStatement.executeQuery();
|
||||
|
||||
while (resultSet.next()) {
|
||||
uuids.add(UUID.fromString(resultSet.getString("uuid")));
|
||||
|
Loading…
Reference in New Issue
Block a user