mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2026-01-01 06:38:46 +01:00
fix: trial synchronising SQLManager#sendBatch
- I don't think this is likely to cause any issues; I don't see any reason for deadlocks/excessive waits here - attempts to address #4612 - this is the only reason I can find that there would be some kind of race condition that sets auto commit whilst attempting to commit from the main thread and would also explain why we get the NoSuchElementException in the above issue as well
This commit is contained in:
@@ -389,7 +389,7 @@ public class SQLManager implements AbstractDB {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean sendBatch() {
|
public synchronized boolean sendBatch() {
|
||||||
try {
|
try {
|
||||||
if (!getGlobalTasks().isEmpty()) {
|
if (!getGlobalTasks().isEmpty()) {
|
||||||
if (this.connection.getAutoCommit()) {
|
if (this.connection.getAutoCommit()) {
|
||||||
|
|||||||
@@ -391,8 +391,7 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer,
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
for (PlotArea area : this.plotAreaManager.getPlotAreasSet(world)) {
|
for (PlotArea area : this.plotAreaManager.getPlotAreasSet(world)) {
|
||||||
if (!Settings.Done.COUNTS_TOWARDS_LIMIT) {
|
if (!Settings.Done.COUNTS_TOWARDS_LIMIT) {
|
||||||
count +=
|
count += area.getPlotsAbs(uuid).stream().filter(plot -> !DoneFlag.isDone(plot)).count();
|
||||||
area.getPlotsAbs(uuid).stream().filter(plot -> !DoneFlag.isDone(plot)).count();
|
|
||||||
} else {
|
} else {
|
||||||
count += area.getPlotsAbs(uuid).size();
|
count += area.getPlotsAbs(uuid).size();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user