diff --git a/common/src/main/java/me/lucko/luckperms/common/api/internal/DatastoreLink.java b/common/src/main/java/me/lucko/luckperms/common/api/internal/DatastoreLink.java index 90324ebe..5b90acea 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/internal/DatastoreLink.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/internal/DatastoreLink.java @@ -27,7 +27,7 @@ import lombok.NonNull; import me.lucko.luckperms.api.*; import me.lucko.luckperms.api.data.Callback; 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.UUID; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/AbstractDatastore.java b/common/src/main/java/me/lucko/luckperms/common/storage/AbstractDatastore.java index 48465c86..5bc7c1ef 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/AbstractDatastore.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/AbstractDatastore.java @@ -30,6 +30,7 @@ import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.storage.backing.AbstractBacking; import me.lucko.luckperms.common.tracks.Track; import me.lucko.luckperms.common.users.User; +import me.lucko.luckperms.common.utils.AbstractFuture; import me.lucko.luckperms.common.utils.LPFuture; import java.util.Set; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/SplitBacking.java b/common/src/main/java/me/lucko/luckperms/common/storage/SplitBacking.java index c8164fcf..c0a63c78 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/SplitBacking.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/SplitBacking.java @@ -31,6 +31,7 @@ import me.lucko.luckperms.common.data.Log; import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.tracks.Track; import me.lucko.luckperms.common.users.User; +import me.lucko.luckperms.common.utils.AbstractFuture; import me.lucko.luckperms.common.utils.LPFuture; import java.util.Map; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java b/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java index d138d5f0..72294773 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java @@ -84,7 +84,7 @@ public class StorageFactory { private static Datastore fromString(String storageMethod, LuckPermsPlugin plugin) { switch (storageMethod) { 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); return bod; case "sqlite": diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/AbstractFuture.java b/common/src/main/java/me/lucko/luckperms/common/utils/AbstractFuture.java similarity index 95% rename from common/src/main/java/me/lucko/luckperms/common/storage/AbstractFuture.java rename to common/src/main/java/me/lucko/luckperms/common/utils/AbstractFuture.java index e0b96328..a4e5b428 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/AbstractFuture.java +++ b/common/src/main/java/me/lucko/luckperms/common/utils/AbstractFuture.java @@ -20,9 +20,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage; - -import me.lucko.luckperms.common.utils.LPFuture; +package me.lucko.luckperms.common.utils; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/Buffer.java b/common/src/main/java/me/lucko/luckperms/common/utils/Buffer.java index 3bb9725f..95ea2b19 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/Buffer.java +++ b/common/src/main/java/me/lucko/luckperms/common/utils/Buffer.java @@ -26,7 +26,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NonNull; import lombok.Setter; -import me.lucko.luckperms.common.storage.AbstractFuture; import java.util.LinkedList; import java.util.List; @@ -38,7 +37,7 @@ import java.util.ListIterator; * @param the type of result produced by the final process */ public abstract class Buffer 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> buffer = new LinkedList<>(); diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/BufferedRequest.java b/common/src/main/java/me/lucko/luckperms/common/utils/BufferedRequest.java index 9fb223da..08dfb722 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/BufferedRequest.java +++ b/common/src/main/java/me/lucko/luckperms/common/utils/BufferedRequest.java @@ -24,7 +24,6 @@ package me.lucko.luckperms.common.utils; import lombok.Getter; import lombok.RequiredArgsConstructor; -import me.lucko.luckperms.common.storage.AbstractFuture; import java.lang.ref.WeakReference; import java.util.concurrent.locks.ReentrantLock;