Fix some #saveX methods being waited for, when they can just be ran async

This commit is contained in:
Luck 2016-10-22 09:35:11 +01:00
parent 77e70ef8d3
commit 6b3aab66bf
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
9 changed files with 19 additions and 19 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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.");

View File

@ -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);
}
}

View File

@ -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.");

View File

@ -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());

View File

@ -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());

View File

@ -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();
}