Fix the MPDB migrator failing

feat/data-edit-commands
William 3 years ago
parent fb390d4b69
commit 7f184c8586

@ -11,7 +11,7 @@ plugins {
allprojects {
group 'me.William278'
version '1.1.1'
version '1.1.2'
compileJava { options.encoding = 'UTF-8' }
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }

@ -15,7 +15,7 @@ public abstract class Database {
public Database(HuskSyncBungeeCord instance, Settings.SynchronisationCluster cluster) {
this.plugin = instance;
this.cluster = cluster;
this.dataPoolName = "HuskSyncHikariPool-" + cluster.clusterId();
this.dataPoolName = cluster != null ? "HuskSyncHikariPool-" + cluster.clusterId() : "HuskSyncMigratorPool";
}
public abstract Connection getConnection() throws SQLException;

@ -80,7 +80,7 @@ public class MPDBMigrator {
// Get connection to source database
sourceDatabase = new MigratorMySQL(plugin, settings.sourceHost, settings.sourcePort,
settings.sourceDatabase, settings.sourceUsername, settings.sourcePassword);
settings.sourceDatabase, settings.sourceUsername, settings.sourcePassword, targetCluster);
sourceDatabase.load();
if (sourceDatabase.isInactive()) {
plugin.getLogger().log(Level.WARNING, "Failed to establish connection to the origin MySQL database. " +
@ -287,8 +287,8 @@ public class MPDBMigrator {
* MySQL class used for importing data from MPDB
*/
public static class MigratorMySQL extends MySQL {
public MigratorMySQL(HuskSyncBungeeCord instance, String host, int port, String database, String username, String password) {
super(instance, null);
public MigratorMySQL(HuskSyncBungeeCord instance, String host, int port, String database, String username, String password, Settings.SynchronisationCluster cluster) {
super(instance, cluster);
super.host = host;
super.port = port;
super.database = database;

Loading…
Cancel
Save