Lower buffer time to 1 second. Should resolve any issues with changes being overridden. (related: #32)

This commit is contained in:
Luck 2016-10-22 18:52:51 +01:00
parent 6b3aab66bf
commit 55a0de7899
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
7 changed files with 6 additions and 8 deletions

View File

@ -27,7 +27,7 @@ import lombok.NonNull;
import me.lucko.luckperms.api.*; import me.lucko.luckperms.api.*;
import me.lucko.luckperms.api.data.Callback; import me.lucko.luckperms.api.data.Callback;
import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.LuckPermsPlugin;
import me.lucko.luckperms.common.storage.AbstractFuture; import me.lucko.luckperms.common.utils.AbstractFuture;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;

View File

@ -30,6 +30,7 @@ import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.storage.backing.AbstractBacking; import me.lucko.luckperms.common.storage.backing.AbstractBacking;
import me.lucko.luckperms.common.tracks.Track; import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.AbstractFuture;
import me.lucko.luckperms.common.utils.LPFuture; import me.lucko.luckperms.common.utils.LPFuture;
import java.util.Set; import java.util.Set;

View File

@ -31,6 +31,7 @@ import me.lucko.luckperms.common.data.Log;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.tracks.Track; import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.AbstractFuture;
import me.lucko.luckperms.common.utils.LPFuture; import me.lucko.luckperms.common.utils.LPFuture;
import java.util.Map; import java.util.Map;

View File

@ -84,7 +84,7 @@ public class StorageFactory {
private static Datastore fromString(String storageMethod, LuckPermsPlugin plugin) { private static Datastore fromString(String storageMethod, LuckPermsPlugin plugin) {
switch (storageMethod) { switch (storageMethod) {
case "mysql": case "mysql":
BufferedOutputDatastore bod = BufferedOutputDatastore.wrap(AbstractDatastore.wrap(new MySQLBacking(plugin, plugin.getConfiguration().getDatabaseValues())), 3000L); BufferedOutputDatastore bod = BufferedOutputDatastore.wrap(AbstractDatastore.wrap(new MySQLBacking(plugin, plugin.getConfiguration().getDatabaseValues())), 1000L);
plugin.doAsyncRepeating(bod, 10L); plugin.doAsyncRepeating(bod, 10L);
return bod; return bod;
case "sqlite": case "sqlite":

View File

@ -20,9 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.storage; package me.lucko.luckperms.common.utils;
import me.lucko.luckperms.common.utils.LPFuture;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;

View File

@ -26,7 +26,6 @@ import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NonNull; import lombok.NonNull;
import lombok.Setter; import lombok.Setter;
import me.lucko.luckperms.common.storage.AbstractFuture;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -38,7 +37,7 @@ import java.util.ListIterator;
* @param <R> the type of result produced by the final process * @param <R> the type of result produced by the final process
*/ */
public abstract class Buffer<T, R> implements Runnable { public abstract class Buffer<T, R> implements Runnable {
private static final long DEFAULT_FLUSH_TIME = 5000; // 5 seconds private static final long DEFAULT_FLUSH_TIME = 1000; // 1 second
private final List<BufferedObject<T, R>> buffer = new LinkedList<>(); private final List<BufferedObject<T, R>> buffer = new LinkedList<>();

View File

@ -24,7 +24,6 @@ package me.lucko.luckperms.common.utils;
import lombok.Getter; import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import me.lucko.luckperms.common.storage.AbstractFuture;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;