Skip to content

Commit

Permalink
Don't run database migrations on plugin enable with issues connecting
Browse files Browse the repository at this point in the history
Migrations rely on `this.databaseConnector` being set which might be true if something fails
  • Loading branch information
SpraxDev committed Oct 23, 2023
1 parent 0bbc5af commit 4816438
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ private void load(DatabaseType forcedType) {
}
this.type = databaseConnector.getType();
this.plugin.getLogger().info("Data handler connected using " + databaseConnector.getType().name() + ".");

runMigrations();
} catch (Exception ex) {
this.plugin.getLogger().severe("Fatal error trying to connect to database. Please make sure all your connection settings are correct and try again. Plugin has been disabled.");
ex.printStackTrace();
Bukkit.getPluginManager().disablePlugin(this.plugin);
}

runMigrations();
}

/**
Expand Down

0 comments on commit 4816438

Please sign in to comment.