mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-27 21:29:47 +01:00
Fix some #saveX methods being waited for, when they can just be ran async
This commit is contained in:
parent
77e70ef8d3
commit
6b3aab66bf
@ -133,7 +133,7 @@ public class MigrationBPermissions extends SubCommand<Object> {
|
||||
}
|
||||
|
||||
migrateHolder(plugin, world, group, lpGroup);
|
||||
plugin.getDatastore().saveGroup(lpGroup).getOrDefault(false);
|
||||
plugin.getDatastore().saveGroup(lpGroup);
|
||||
}
|
||||
log.info("bPermissions Migration: Migrated " + groupCount + " groups in world " + world.getName() + ".");
|
||||
|
||||
@ -162,7 +162,7 @@ public class MigrationBPermissions extends SubCommand<Object> {
|
||||
|
||||
migrateHolder(plugin, world, user, lpUser);
|
||||
|
||||
plugin.getDatastore().saveUser(lpUser).getOrDefault(false);
|
||||
plugin.getDatastore().saveUser(lpUser);
|
||||
plugin.getUserManager().cleanup(lpUser);
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ public class MigrationBungeePerms extends SubCommand<Object> {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getDatastore().saveGroup(group).getOrDefault(false);
|
||||
plugin.getDatastore().saveGroup(group);
|
||||
}
|
||||
|
||||
log.info("BungeePerms Migration: Migrated " + groupCount + " groups");
|
||||
@ -288,7 +288,7 @@ public class MigrationBungeePerms extends SubCommand<Object> {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getDatastore().saveUser(user).getOrDefault(false);
|
||||
plugin.getDatastore().saveUser(user);
|
||||
plugin.getUserManager().cleanup(user);
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ public class MigrationGroupManager extends SubCommand<Object> {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getDatastore().saveGroup(group).getOrDefault(false);
|
||||
plugin.getDatastore().saveGroup(group);
|
||||
}
|
||||
|
||||
Map<UUID, Map<Map.Entry<String, String>, Boolean>> users = new HashMap<>();
|
||||
@ -241,7 +241,7 @@ public class MigrationGroupManager extends SubCommand<Object> {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getDatastore().saveGroup(group).getOrDefault(false);
|
||||
plugin.getDatastore().saveGroup(group);
|
||||
}
|
||||
|
||||
for (Map.Entry<UUID, Map<Map.Entry<String, String>, Boolean>> e : users.entrySet()) {
|
||||
@ -275,7 +275,7 @@ public class MigrationGroupManager extends SubCommand<Object> {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getDatastore().saveUser(user).getOrDefault(false);
|
||||
plugin.getDatastore().saveUser(user);
|
||||
plugin.getUserManager().cleanup(user);
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ public class MigrationPermissionsEx extends SubCommand<Object> {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getDatastore().saveGroup(lpGroup).getOrDefault(false);
|
||||
plugin.getDatastore().saveGroup(lpGroup);
|
||||
|
||||
}
|
||||
|
||||
@ -387,7 +387,7 @@ public class MigrationPermissionsEx extends SubCommand<Object> {
|
||||
}
|
||||
|
||||
plugin.getUserManager().cleanup(lpUser);
|
||||
plugin.getDatastore().saveUser(lpUser).getOrDefault(false);
|
||||
plugin.getDatastore().saveUser(lpUser);
|
||||
}
|
||||
|
||||
log.info("PermissionsEx Migration: Migrated " + userCount + " users.");
|
||||
|
@ -275,7 +275,7 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getDatastore().saveGroup(group).getOrDefault(false);
|
||||
plugin.getDatastore().saveGroup(group);
|
||||
}
|
||||
log.info("PowerfulPerms Migration: Group migration complete.");
|
||||
|
||||
@ -299,7 +299,7 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
|
||||
synchronized (progress) {
|
||||
progress.get(uuid).countDown();
|
||||
if (progress.get(uuid).getCount() == 0) {
|
||||
plugin.getDatastore().saveUser(user).getOrDefault(false);
|
||||
plugin.getDatastore().saveUser(user);
|
||||
plugin.getUserManager().cleanup(user);
|
||||
}
|
||||
}
|
||||
@ -422,7 +422,7 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
|
||||
synchronized (progress) {
|
||||
progress.get(uuid).countDown();
|
||||
if (progress.get(uuid).getCount() == 0) {
|
||||
plugin.getDatastore().saveUser(user).getOrDefault(false);
|
||||
plugin.getDatastore().saveUser(user);
|
||||
plugin.getUserManager().cleanup(user);
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ public class MigrationZPermissions extends SubCommand<Object> {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getDatastore().saveGroup(group).getOrDefault(false);
|
||||
plugin.getDatastore().saveGroup(group);
|
||||
}
|
||||
|
||||
// Migrate all tracks
|
||||
@ -144,7 +144,7 @@ public class MigrationZPermissions extends SubCommand<Object> {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getDatastore().saveTrack(track).getOrDefault(false);
|
||||
plugin.getDatastore().saveTrack(track);
|
||||
}
|
||||
|
||||
// Migrate all users.
|
||||
@ -243,7 +243,7 @@ public class MigrationZPermissions extends SubCommand<Object> {
|
||||
}
|
||||
|
||||
plugin.getUserManager().cleanup(user);
|
||||
plugin.getDatastore().saveUser(user).getOrDefault(false);
|
||||
plugin.getDatastore().saveUser(user);
|
||||
}
|
||||
|
||||
log.info("zPermissions Migration: Success! Completed without any errors.");
|
||||
|
@ -137,8 +137,8 @@ public class BulkEditGroup extends SubCommand<Datastore> {
|
||||
} catch (ObjectAlreadyHasException ignored) {}
|
||||
});
|
||||
|
||||
plugin.getDatastore().saveUser(user);
|
||||
plugin.getUserManager().cleanup(user);
|
||||
plugin.getDatastore().saveUser(user).getOrDefault(false);
|
||||
}
|
||||
|
||||
Message.BULK_CHANGE_SUCCESS.send(sender, uuids.size());
|
||||
|
@ -127,8 +127,8 @@ public class BulkEditPermission extends SubCommand<Datastore> {
|
||||
} catch (ObjectAlreadyHasException ignored) {}
|
||||
});
|
||||
|
||||
plugin.getDatastore().saveUser(user);
|
||||
plugin.getUserManager().cleanup(user);
|
||||
plugin.getDatastore().saveUser(user).getOrDefault(false);
|
||||
}
|
||||
|
||||
Message.BULK_CHANGE_SUCCESS.send(sender, uuids.size());
|
||||
|
@ -36,14 +36,14 @@ public class ExpireTemporaryTask implements Runnable {
|
||||
boolean groupChanges = false;
|
||||
for (Group group : plugin.getGroupManager().getAll().values()) {
|
||||
if (group.auditTemporaryPermissions()) {
|
||||
plugin.getDatastore().saveGroup(group).getOrDefault(false);
|
||||
plugin.getDatastore().saveGroup(group);
|
||||
groupChanges = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (User user : plugin.getUserManager().getAll().values()) {
|
||||
if (user.auditTemporaryPermissions()) {
|
||||
plugin.getDatastore().saveUser(user).getOrDefault(false);
|
||||
plugin.getDatastore().saveUser(user);
|
||||
if (!groupChanges) {
|
||||
user.getRefreshBuffer().request();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user