Skip to content

Commit 4332739

Browse files
committed
fix: only remove empty tasks
Signed-off-by: Florian Reuth <git@florianreuth.de>
1 parent b573ef8 commit 4332739

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Core/src/main/java/com/plotsquared/core/database/SQLManager.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,8 @@ public synchronized boolean sendBatch() {
562562
this.connection.setAutoCommit(true);
563563
}
564564
}
565-
if (!this.clusterTasks.isEmpty()) {
566-
this.clusterTasks.clear();
567-
}
568-
if (!this.plotTasks.isEmpty()) {
569-
this.plotTasks.clear();
570-
}
565+
this.clusterTasks.entrySet().removeIf(e -> e.getValue().isEmpty());
566+
this.plotTasks.entrySet().removeIf(e -> e.getValue().isEmpty());
571567
} catch (Throwable e) {
572568
LOGGER.error("============ DATABASE ERROR ============");
573569
LOGGER.error("There was an error updating the database.");

0 commit comments

Comments
 (0)