Try to fix MySQL flushing hanging.

This commit is contained in:
AppleDash 2017-06-14 19:50:27 -04:00
parent 94bac07727
commit 3678f71dc7

View File

@ -106,11 +106,16 @@ public class MySQLConnection {
}
public void waitUntilFlushed() {
long startTime = System.currentTimeMillis();
while (openTransactions.get() > 0) {
if ((System.currentTimeMillis() - startTime) > 5000) {
LOGGER.warning("Took too long to flush all transactions - something has probably hung :(");
break;
}
try {
Thread.sleep(50);
} catch (InterruptedException ignored) {
}
}
}