diff --git a/src/main/java/com/io/yutian/aulib/redis/RedisIO.java b/src/main/java/com/io/yutian/aulib/redis/RedisIO.java index ddff0af..f8f569f 100644 --- a/src/main/java/com/io/yutian/aulib/redis/RedisIO.java +++ b/src/main/java/com/io/yutian/aulib/redis/RedisIO.java @@ -1,7 +1,6 @@ package com.io.yutian.aulib.redis; import com.io.yutian.aulib.util.FileUtil; -import org.bukkit.Bukkit; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.Plugin; @@ -12,7 +11,6 @@ import redis.clients.jedis.JedisPoolConfig; import java.io.File; import java.time.Duration; import java.util.Set; -import java.util.concurrent.FutureTask; public class RedisIO { @@ -32,14 +30,10 @@ public class RedisIO { } try { String finalRedisPassword = redisPassword; - FutureTask task = new FutureTask<>(() -> { - JedisPoolConfig config = new JedisPoolConfig(); - config.setMaxTotal(1024); - config.setMaxWait(Duration.ofMillis(10000)); - return new JedisPool(config, redisServer, redisPort, 0, finalRedisPassword); - }); - Bukkit.getServer().getScheduler().runTaskAsynchronously(plugin, task); - jedisPool = task.get(); + JedisPoolConfig config = new JedisPoolConfig(); + config.setMaxTotal(1024); + config.setMaxWait(Duration.ofMillis(10000)); + jedisPool = new JedisPool(config, redisServer, redisPort, 0, finalRedisPassword); } catch (Exception e) { e.printStackTrace(); }