mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
fix: synchronize confirmExpiry (#3481)
Prevents that the MetaDataAccess is closed before setting the data
This commit is contained in:
parent
16928b05f1
commit
951767dc64
@ -136,6 +136,7 @@ public class ExpireManager {
|
||||
}
|
||||
|
||||
public void confirmExpiry(final PlotPlayer<?> pp) {
|
||||
TaskManager.runTask(() -> {
|
||||
try (final MetaDataAccess<Boolean> metaDataAccess = pp.accessTemporaryMetaData(
|
||||
PlayerMetaDataKeys.TEMPORARY_IGNORE_EXPIRE_TASK)) {
|
||||
if (metaDataAccess.isPresent()) {
|
||||
@ -147,7 +148,6 @@ public class ExpireManager {
|
||||
Iterator<Plot> iter = plotsToDelete.iterator();
|
||||
final Plot current = iter.next();
|
||||
if (!isExpired(new ArrayDeque<>(tasks), current).isEmpty()) {
|
||||
TaskManager.runTask(() -> {
|
||||
metaDataAccess.set(true);
|
||||
current.getCenter(pp::teleport);
|
||||
metaDataAccess.remove();
|
||||
@ -171,7 +171,6 @@ public class ExpireManager {
|
||||
cmd_keep,
|
||||
cmd_no_show_expir
|
||||
);
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
iter.remove();
|
||||
@ -180,6 +179,7 @@ public class ExpireManager {
|
||||
plotsToDelete.clear();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -307,6 +307,7 @@ public class ExpireManager {
|
||||
this.running = 2;
|
||||
TaskManager.runTaskAsync(new Runnable() {
|
||||
private ConcurrentLinkedDeque<Plot> plots = null;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
final Runnable task = this;
|
||||
|
Loading…
Reference in New Issue
Block a user