From 29b252565f6ba3e572b5588640e64112ab55054c Mon Sep 17 00:00:00 2001 From: YuTian <2953516620@qq.com> Date: Mon, 22 Jul 2024 16:52:41 +0800 Subject: [PATCH] v2.5 --- .../java/com/io/yutian/aulib/redis/RedisCacheSyncTimer.java | 6 +++--- .../com/io/yutian/aulib/redis/RedisCacheSynchronizer.java | 2 +- src/main/resources/plugin.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/io/yutian/aulib/redis/RedisCacheSyncTimer.java b/src/main/java/com/io/yutian/aulib/redis/RedisCacheSyncTimer.java index 9f87290..0a7e46e 100644 --- a/src/main/java/com/io/yutian/aulib/redis/RedisCacheSyncTimer.java +++ b/src/main/java/com/io/yutian/aulib/redis/RedisCacheSyncTimer.java @@ -13,7 +13,7 @@ import java.util.Map; public class RedisCacheSyncTimer { private static final String LOCK_KEY = "sync_lock"; - private static final int LOCK_EXPIRE_SECONDS = 600; + private static final int LOCK_EXPIRE_SECONDS = 300; private final Map pluginInfos = new HashMap<>(); private BukkitTask task; @@ -53,7 +53,7 @@ public class RedisCacheSyncTimer { } if (data != null) { String finalData = data; - synchronizer.sync(finalData); + synchronizer.sync(k, finalData); if (k2 == null) { jedis.del(k); } else { @@ -65,7 +65,7 @@ public class RedisCacheSyncTimer { } } } - }.runTaskTimerAsynchronously(AuLib.inst(), 0L, 10L * 20 * 60L); + }.runTaskTimerAsynchronously(AuLib.inst(), 60L, 5 * 60 * 20L); } public void registerSynchronizer(Plugin plugin, IJedisGetter jedisGetter, Pair key, RedisCacheSynchronizer synchronizer) { diff --git a/src/main/java/com/io/yutian/aulib/redis/RedisCacheSynchronizer.java b/src/main/java/com/io/yutian/aulib/redis/RedisCacheSynchronizer.java index 6c0c6d7..d6904b9 100644 --- a/src/main/java/com/io/yutian/aulib/redis/RedisCacheSynchronizer.java +++ b/src/main/java/com/io/yutian/aulib/redis/RedisCacheSynchronizer.java @@ -3,6 +3,6 @@ package com.io.yutian.aulib.redis; @FunctionalInterface public interface RedisCacheSynchronizer { - void sync(String data); + void sync(String key, String data); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 5bfdb67..1b084e4 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: AuLib main: com.io.yutian.aulib.AuLib -version: 2.4 +version: 2.5 api-version: 1.18 author: SuperYuTian \ No newline at end of file