Configurable save-on-stop-only for UserCache

By: drXor <mcyoungsota@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2014-05-23 18:05:10 -04:00
parent 7e097e5d53
commit 7bee9a20b3
3 changed files with 86 additions and 51 deletions

View File

@@ -9,7 +9,16 @@
}
};
@@ -142,7 +142,7 @@
@@ -117,7 +117,7 @@
GameProfileCache.GameProfileInfo usercache_usercacheentry = new GameProfileCache.GameProfileInfo(profile, date);
this.safeAdd(usercache_usercacheentry);
- this.save();
+ if( !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly ) this.save(); // Spigot - skip saving if disabled
}
private long getNextOperation() {
@@ -142,14 +142,14 @@
usercache_usercacheentry.setLastAccess(this.getNextOperation());
optional = Optional.of(usercache_usercacheentry.getProfile());
} else {
@@ -18,6 +27,14 @@
if (optional.isPresent()) {
this.add((GameProfile) optional.get());
flag = false;
}
}
- if (flag) {
+ if (flag && !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { // Spigot - skip saving if disabled
this.save();
}
@@ -208,7 +208,7 @@
label54: