mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
WE SERIOUSLY NEED TO FIX THIS ISSUE AT SOME POINT
(THIS IS NOT THE OFFICIAL FIX, JUST A TEMPORARY THING)
This commit is contained in:
parent
f0d2fd93dd
commit
8e6608d613
@ -66,6 +66,8 @@ public class SQLManager implements AbstractDB {
|
|||||||
// Private final
|
// Private final
|
||||||
connection = c;
|
connection = c;
|
||||||
prefix = p;
|
prefix = p;
|
||||||
|
// Set timout
|
||||||
|
setTimout();
|
||||||
// Public final
|
// Public final
|
||||||
SET_OWNER =
|
SET_OWNER =
|
||||||
"UPDATE `" + prefix + "plot` SET `owner` = ? WHERE `plot_id_x` = ? AND `plot_id_z` = ?";
|
"UPDATE `" + prefix + "plot` SET `owner` = ? WHERE `plot_id_x` = ? AND `plot_id_z` = ?";
|
||||||
@ -81,6 +83,22 @@ public class SQLManager implements AbstractDB {
|
|||||||
"INSERT INTO `" + prefix + "plot`(`plot_id_x`, `plot_id_z`, `owner`, `world`) VALUES(?, ?, ?, ?)";
|
"INSERT INTO `" + prefix + "plot`(`plot_id_x`, `plot_id_z`, `owner`, `world`) VALUES(?, ?, ?, ?)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setTimout() {
|
||||||
|
runTask(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
final PreparedStatement statement = connection.prepareStatement("SET GLOBAL wait_timeout =28800;");
|
||||||
|
statement.executeUpdate();
|
||||||
|
statement.close();
|
||||||
|
} catch (final SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Logger.add(LogLevel.DANGER, "Could not reset MySQL timout.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Plot owner
|
* Set Plot owner
|
||||||
*
|
*
|
||||||
@ -265,6 +283,10 @@ public class SQLManager implements AbstractDB {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void createTables(final String database, final boolean add_constraint) throws SQLException {
|
public void createTables(final String database, final boolean add_constraint) throws SQLException {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final boolean mysql = database.equals("mysql");
|
final boolean mysql = database.equals("mysql");
|
||||||
final Statement stmt = connection.createStatement();
|
final Statement stmt = connection.createStatement();
|
||||||
if (mysql) {
|
if (mysql) {
|
||||||
|
Loading…
Reference in New Issue
Block a user