mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +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;
|
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
|
@Override
|
||||||
public Connection openConnection() throws SQLException, ClassNotFoundException {
|
public Connection openConnection() throws SQLException, ClassNotFoundException {
|
||||||
if (checkConnection()) {
|
if (checkConnection()) {
|
||||||
|
@ -86,13 +86,13 @@ public class SQLManager implements AbstractDB {
|
|||||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(PlotMain.getMain(), new Runnable(){
|
Bukkit.getScheduler().scheduleSyncRepeatingTask(PlotMain.getMain(), new Runnable(){
|
||||||
public void run(){
|
public void run(){
|
||||||
try {
|
try {
|
||||||
connection = PlotMain.getMySQL().openConnection();
|
connection = PlotMain.getMySQL().forceConnection();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 500000, 500000);
|
}, 11000, 11000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user