Reduced interval

This commit is contained in:
boy0001 2014-12-14 12:42:23 +11:00
parent 7266a2a875
commit fd306bf0a9
2 changed files with 8 additions and 2 deletions

View File

@ -60,6 +60,12 @@ public class MySQL extends Database {
this.connection = null;
}
public Connection forceConnection() throws SQLException, ClassNotFoundException {
Class.forName("com.mysql.jdbc.Driver");
this.connection = DriverManager.getConnection("jdbc:mysql://" + this.hostname + ":" + this.port + "/" + this.database, this.user, this.password);
return this.connection;
}
@Override
public Connection openConnection() throws SQLException, ClassNotFoundException {
if (checkConnection()) {

View File

@ -86,13 +86,13 @@ public class SQLManager implements AbstractDB {
Bukkit.getScheduler().scheduleSyncRepeatingTask(PlotMain.getMain(), new Runnable(){
public void run(){
try {
connection = PlotMain.getMySQL().openConnection();
connection = PlotMain.getMySQL().forceConnection();
}
catch (Exception e) {
e.printStackTrace();
}
}
}, 500000, 500000);
}, 11000, 11000);
}