mirror of
https://github.com/AppleDash/SaneEconomy.git
synced 2024-11-25 19:45:48 +01:00
Try to fix MySQL flushing hanging.
This commit is contained in:
parent
94bac07727
commit
3678f71dc7
@ -106,11 +106,16 @@ public class MySQLConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void waitUntilFlushed() {
|
public void waitUntilFlushed() {
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
while (openTransactions.get() > 0) {
|
while (openTransactions.get() > 0) {
|
||||||
|
if ((System.currentTimeMillis() - startTime) > 5000) {
|
||||||
|
LOGGER.warning("Took too long to flush all transactions - something has probably hung :(");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep(50);
|
Thread.sleep(50);
|
||||||
} catch (InterruptedException ignored) {
|
} catch (InterruptedException ignored) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user