mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-09 09:59:48 +01:00
Reduced interval
This commit is contained in:
parent
7266a2a875
commit
fd306bf0a9
@ -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()) {
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user