diff --git a/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java b/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java index d75519aa3..0cedfd6ec 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java @@ -71,7 +71,6 @@ public abstract class SQLDB extends Database { try { setupDataSource(); setupDatabase(); - scheduleClean(10L); open = true; } finally { Benchmark.stop("Database", benchName); diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/file/database/DBSystem.java b/Plan/src/main/java/com/djrapitops/plan/systems/file/database/DBSystem.java index 2598976a0..1860a9785 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/file/database/DBSystem.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/file/database/DBSystem.java @@ -10,6 +10,7 @@ import com.djrapitops.plugin.utilities.Verify; import main.java.com.djrapitops.plan.api.exceptions.DatabaseInitException; import main.java.com.djrapitops.plan.api.exceptions.PlanEnableException; import main.java.com.djrapitops.plan.database.Database; +import main.java.com.djrapitops.plan.database.databases.SQLDB; import main.java.com.djrapitops.plan.settings.locale.Locale; import main.java.com.djrapitops.plan.settings.locale.Msg; import main.java.com.djrapitops.plan.systems.SubSystem; @@ -25,8 +26,8 @@ import java.util.Set; */ public abstract class DBSystem implements SubSystem { - protected Database db; - protected Set databases; + protected SQLDB db; + protected Set databases; public static DBSystem getInstance() { return Systems.getInstance().getDatabaseSystem(); @@ -38,6 +39,7 @@ public abstract class DBSystem implements SubSystem { Benchmark.start("Init Database"); Log.info(Locale.get(Msg.ENABLE_DB_INIT).toString()); initDatabase(); + db.scheduleClean(10L); Log.info(Locale.get(Msg.ENABLE_DB_INFO).parse(db.getConfigName())); Benchmark.stop("Systems", "Init Database"); } catch (DatabaseInitException e) { @@ -47,11 +49,11 @@ public abstract class DBSystem implements SubSystem { protected abstract void initDatabase() throws DatabaseInitException; - public Set getDatabases() { + public Set getDatabases() { return databases; } - public void setDatabases(Set databases) { + public void setDatabases(Set databases) { this.databases = databases; } @@ -70,8 +72,8 @@ public abstract class DBSystem implements SubSystem { return db; } - public static Database getActiveDatabase(String dbName) throws DatabaseInitException { - for (Database database : DBSystem.getInstance().getDatabases()) { + public static SQLDB getActiveDatabase(String dbName) throws DatabaseInitException { + for (SQLDB database : DBSystem.getInstance().getDatabases()) { String dbConfigName = database.getConfigName(); if (Verify.equalsIgnoreCase(dbName, dbConfigName)) { database.init(); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/file/FileUtil.java b/Plan/src/main/java/com/djrapitops/plan/utilities/file/FileUtil.java index a312511dc..5fd9627a6 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/file/FileUtil.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/file/FileUtil.java @@ -103,5 +103,4 @@ public class FileUtil { } return lines; } - -} +} \ No newline at end of file