mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-10-31 07:39:42 +01:00
Prevent deadlock in LuckPermsHandler #1350
This commit is contained in:
parent
7afda20288
commit
45dda0deba
@ -19,6 +19,9 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -63,7 +66,11 @@ public class LuckPermsHandler implements PermissionHandler {
|
||||
if (user == null) {
|
||||
// user not loaded, we need to load them from the storage.
|
||||
// this is a blocking call.
|
||||
luckPermsApi.getStorage().loadUser(playerUuid).join();
|
||||
try {
|
||||
luckPermsApi.getStorage().loadUser(playerUuid).get(1, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException | TimeoutException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// then grab a new instance
|
||||
user = luckPermsApi.getUser(playerUuid);
|
||||
|
Loading…
Reference in New Issue
Block a user