feat: 使用JedisPool代替JedisPooled
This commit is contained in:
@@ -8,7 +8,7 @@ import com.zaxxer.hikari.HikariDataSource;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.kyori.adventure.platform.AudienceProvider;
|
import net.kyori.adventure.platform.AudienceProvider;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import redis.clients.jedis.JedisPooled;
|
import redis.clients.jedis.JedisPool;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
@@ -27,7 +27,7 @@ public abstract class CoreAPI {
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@NotNull
|
@NotNull
|
||||||
private final JedisPooled jedisPool;
|
private final JedisPool jedisPool;
|
||||||
/**
|
/**
|
||||||
* HamsterCore 公用数据库连接池
|
* HamsterCore 公用数据库连接池
|
||||||
*/
|
*/
|
||||||
@@ -50,7 +50,7 @@ public abstract class CoreAPI {
|
|||||||
scheduledService = Executors.newScheduledThreadPool(1, new NamedThreadFactory("HamsterCore - Scheduler"));
|
scheduledService = Executors.newScheduledThreadPool(1, new NamedThreadFactory("HamsterCore - Scheduler"));
|
||||||
|
|
||||||
getLogger().info("正在创建 redis 连接池");
|
getLogger().info("正在创建 redis 连接池");
|
||||||
jedisPool = new JedisPooled(config.getString("redis-url"));
|
jedisPool = new JedisPool(config.getString("redis-url"));
|
||||||
getLogger().info("redis 连接池创建完成");
|
getLogger().info("redis 连接池创建完成");
|
||||||
|
|
||||||
ConfigSection datasourceConfig = config.getSection("datasource");
|
ConfigSection datasourceConfig = config.getSection("datasource");
|
||||||
|
Reference in New Issue
Block a user