Skip to content

Commit 693b2de

Browse files
committed
Set default pool name for MySQL configuration if empty
1 parent 56c8284 commit 693b2de

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/userstorage/mysql/MySQL.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public MySQL(AdvancedCorePlugin plugin, String tableName, ConfigurationSection s
7575
if (config.getTablePrefix() != null) {
7676
name = config.getTablePrefix() + tableName;
7777
}
78+
if (config.getPoolName().isEmpty()) {
79+
config.setPoolName(plugin.getName() + "-" + tableName);
80+
}
7881
mysql = new com.bencodez.simpleapi.sql.mysql.MySQL(config.getMaxThreads()) {
7982

8083
@Override
@@ -90,7 +93,7 @@ public void severe(String string) {
9093
@Override
9194
public void debug(String msg) {
9295
plugin.debug(msg);
93-
96+
9497
}
9598
};
9699
if (!mysql.connect(config)) {

AdvancedCore/src/main/java/com/bencodez/advancedcore/bungeeapi/globaldata/GlobalMySQL.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public GlobalMySQL(String tableName, MysqlConfig config) {
7070
if (config.getTablePrefix() != null) {
7171
name = config.getTablePrefix() + tableName;
7272
}
73+
if (config.getPoolName().isEmpty()) {
74+
config.setPoolName("VotingPlugin" + "-" + tableName);
75+
}
7376
mysql = new com.bencodez.simpleapi.sql.mysql.MySQL(config.getMaxThreads()) {
7477

7578
@Override

0 commit comments

Comments
 (0)