feat: 将 lettuce 改为 jedis
This commit is contained in:
@@ -5,24 +5,22 @@ dependencies {
|
||||
// https://mvnrepository.com/artifact/org.yaml/snakeyaml
|
||||
compileOnly("org.yaml:snakeyaml:1.19")
|
||||
|
||||
implementation("net.kyori:adventure-platform-api:4.3.2") {
|
||||
compileOnly("net.kyori:adventure-platform-api:4.3.2") {
|
||||
exclude(group = "org.jetbrains")
|
||||
}
|
||||
implementation("net.kyori:adventure-text-serializer-gson:4.13.1") {
|
||||
compileOnly("net.kyori:adventure-text-serializer-gson:4.13.1") {
|
||||
exclude(group = "org.jetbrains")
|
||||
exclude(group = "com.google.code.gson")
|
||||
}
|
||||
|
||||
|
||||
// https://mvnrepository.com/artifact/com.zaxxer/HikariCP
|
||||
compileOnly("com.zaxxer:HikariCP:5.1.0") { isTransitive = false }
|
||||
// https://mvnrepository.com/artifact/io.lettuce/lettuce-core
|
||||
implementation("io.lettuce:lettuce-core:6.3.1.RELEASE") {
|
||||
exclude(group = "io.netty")
|
||||
}
|
||||
implementation("org.quartz-scheduler:quartz:2.3.2") {
|
||||
isTransitive = false
|
||||
compileOnly("com.zaxxer:HikariCP:4.0.3") { isTransitive = false }
|
||||
// https://mvnrepository.com/artifact/redis.clients/jedis
|
||||
implementation("redis.clients:jedis:5.1.2") {
|
||||
exclude(group = "com.google.code.gson")
|
||||
exclude(group = "org.slf4j")
|
||||
}
|
||||
compileOnly("org.quartz-scheduler:quartz:2.3.2") { isTransitive = false }
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
@@ -5,10 +5,10 @@ import cn.hamster3.mc.plugin.core.common.thread.NamedThreadFactory;
|
||||
import com.google.gson.Gson;
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import io.lettuce.core.RedisClient;
|
||||
import lombok.Getter;
|
||||
import net.kyori.adventure.platform.AudienceProvider;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import redis.clients.jedis.JedisPool;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
@@ -23,11 +23,11 @@ public abstract class CoreAPI {
|
||||
@Getter
|
||||
protected static CoreAPI instance;
|
||||
/**
|
||||
* lettuce redis 客户端
|
||||
* Redis 连接池
|
||||
*/
|
||||
@Getter
|
||||
@NotNull
|
||||
private final RedisClient redisClient;
|
||||
private final JedisPool jedisPool;
|
||||
/**
|
||||
* HamsterCore 公用数据库连接池
|
||||
*/
|
||||
@@ -50,7 +50,7 @@ public abstract class CoreAPI {
|
||||
scheduledService = Executors.newScheduledThreadPool(1, new NamedThreadFactory("HamsterCore - Scheduler"));
|
||||
|
||||
getLogger().info("正在创建 redis 客户端");
|
||||
redisClient = RedisClient.create(config.getString("redis-url"));
|
||||
jedisPool = new JedisPool(config.getString("redis-url"));
|
||||
getLogger().info("redis 客户端创建完成");
|
||||
|
||||
ConfigSection datasourceConfig = config.getSection("datasource");
|
||||
|
Reference in New Issue
Block a user