Merge branch 'release' into master

Former-commit-id: 83d56f0310e94707e198ddf9ecde48f5df7b9e79
This commit is contained in:
Ghost_chu authored and GitHub committed 2020-09-30 20:24:54 +08:00
commit c8c74e06f9
2 files changed
+16 -1

No files matched your search

@@ -121,6 +121,22 @@ public class DatabaseManager {
if (!hasTable(table)) {
return false;
}
private synchronized void runTask() { // synchronized for QUICKSHOP-WX
if (sqlQueue.isEmpty()) {
return;
}
try {
Connection connection = this.database.getConnection();
//start our commit
connection.setAutoCommit(false);
Timer ctimer = new Timer(true);
while (true) {
if (!connection.isValid(3000)) {
warningSender.sendWarn("Database connection may lost, we are trying reconnecting, if this message appear too many times, you should check your database file(sqlite) and internet connection(mysql).");
//connection isn't stable, let autocommit on
connection = database.getConnection();
continue; // Waiting next crycle and hope it success reconnected.
}
DatabaseConnection connection = database.getConnection();
String query = "SELECT * FROM " + table + " LIMIT 1";
@@ -453,7 +453,6 @@ public class MsgUtil {
public static void loadTransactionMessages() {
outGoingPlayerMessages.clear(); // Delete old messages
try (WarpedResultSet warpRS = plugin.getDatabaseHelper().selectAllMessages()) {
ResultSet rs = warpRS.getResultSet();
while (rs.next()) {
String owner = rs.getString("owner");