mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-02-05 23:21:22 +01:00
Catch RejectedExecutionException in BufferedRequest (#2289)
This commit is contained in:
parent
9984d4be42
commit
c7a0e59919
@ -63,6 +63,10 @@ public class BukkitCommandListUpdater {
|
|||||||
|
|
||||||
// Called when a user's data is recalculated.
|
// Called when a user's data is recalculated.
|
||||||
public void onUserDataRecalculate(UserDataRecalculateEvent e) {
|
public void onUserDataRecalculate(UserDataRecalculateEvent e) {
|
||||||
|
if (this.plugin.getBootstrap().isServerStopping()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
UUID uniqueId = e.getUser().getUniqueId();
|
UUID uniqueId = e.getUser().getUniqueId();
|
||||||
if (!this.plugin.getBootstrap().isPlayerOnline(uniqueId)) {
|
if (!this.plugin.getBootstrap().isPlayerOnline(uniqueId)) {
|
||||||
return;
|
return;
|
||||||
|
@ -29,6 +29,7 @@ import me.lucko.luckperms.common.plugin.scheduler.SchedulerAdapter;
|
|||||||
import me.lucko.luckperms.common.plugin.scheduler.SchedulerTask;
|
import me.lucko.luckperms.common.plugin.scheduler.SchedulerTask;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.RejectedExecutionException;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
@ -139,7 +140,12 @@ public abstract class BufferedRequest<T> {
|
|||||||
|
|
||||||
private void scheduleTask() {
|
private void scheduleTask() {
|
||||||
this.boundTask = new CompletionTask();
|
this.boundTask = new CompletionTask();
|
||||||
this.scheduledTask = this.schedulerAdapter.asyncLater(this.boundTask, this.delay, this.unit);
|
try {
|
||||||
|
this.scheduledTask = this.schedulerAdapter.asyncLater(this.boundTask, this.delay, this.unit);
|
||||||
|
} catch (RejectedExecutionException e) {
|
||||||
|
// If we can't schedule the completion in the future, just do it now.
|
||||||
|
this.boundTask.run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CompletableFuture<R> getFuture() {
|
CompletableFuture<R> getFuture() {
|
||||||
|
Loading…
Reference in New Issue
Block a user