mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Fix incorrect usage of CompletableFuture#thenCombineAsync
This commit is contained in:
parent
b6e1fd179e
commit
7fe5397e21
@ -485,10 +485,24 @@ public class LuckPermsSubjectData implements LPSubjectData {
|
|||||||
} else {
|
} else {
|
||||||
if (t instanceof User) {
|
if (t instanceof User) {
|
||||||
User user = ((User) t);
|
User user = ((User) t);
|
||||||
return service.getPlugin().getStorage().saveUser(user).thenCombineAsync(user.getRefreshBuffer().request(), (b, v) -> v, service.getPlugin().getScheduler().async());
|
return service.getPlugin().getStorage().saveUser(user).thenApplyAsync(success -> {
|
||||||
|
if (!success) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
user.getRefreshBuffer().request().join();
|
||||||
|
return null;
|
||||||
|
}, service.getPlugin().getScheduler().async());
|
||||||
} else {
|
} else {
|
||||||
Group group = ((Group) t);
|
Group group = ((Group) t);
|
||||||
return service.getPlugin().getStorage().saveGroup(group).thenCombineAsync(service.getPlugin().getUpdateTaskBuffer().request(), (b, v) -> v, service.getPlugin().getScheduler().async());
|
return service.getPlugin().getStorage().saveGroup(group).thenApplyAsync(success -> {
|
||||||
|
if (!success) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
service.getPlugin().getUpdateTaskBuffer().request().join();
|
||||||
|
return null;
|
||||||
|
}, service.getPlugin().getScheduler().async());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user