Skip to content

Commit

Permalink
Fixed database connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo0111 committed Feb 11, 2022
1 parent c72126b commit 98bbc35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ext {
}

group = "me.lorenzo0111"
version = "1.7"
version = "1.7.1"
description = "MultiLang is a library that allows you to easily create multi-language placeholders."

java {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/me/lorenzo0111/multilang/MultiLangPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitWorker;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -141,7 +140,7 @@ public void onEnable() {

this.reloadRealtimeConfig();
if (translators.isUseCache()) {
translators.loadCache(databaseManager);
Bukkit.getScheduler().scheduleSyncDelayedTask(this, () -> translators.loadCache(databaseManager), 60 * 20L);
}

this.cacheFolder = new File(this.getDataFolder(), "cache");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public static IConnectionHandler createConnection(@NotNull MultiLangPlugin plugi
case MYSQL:
config.setPoolName("MultiLang MySQL Connection Pool");
config.setDriverClassName(driver.getName());
config.setJdbcUrl("jdbc:mysql://" + plugin.getConfig("mysql.ip") + ":" + plugin.getConfig("mysql.port") + "/" + plugin.getConfig("mysql.database"));
config.addDataSourceProperty("serverName", plugin.getConfig("mysql.ip"));
config.addDataSourceProperty("port", plugin.getConfig("mysql.port"));
config.addDataSourceProperty("databaseName", plugin.getConfig("mysql.database"));
Expand Down

0 comments on commit 98bbc35

Please sign in to comment.