feat: 添加 lettuce-core 用于连接 redis
All checks were successful
Publish Project / build (push) Successful in 2m43s

This commit is contained in:
2025-07-03 02:29:02 +08:00
parent 0f942a7687
commit 1648a56453
11 changed files with 95 additions and 22 deletions

View File

@@ -14,13 +14,16 @@ dependencies {
exclude(module = "adventure-api")
exclude(group = "org.jetbrains")
}
// https://mvnrepository.com/artifact/redis.clients/jedis
implementation("com.zaxxer:HikariCP:4.0.3") { exclude(group = "org.slf4j") }
api("redis.clients:jedis:5.1.4") {
exclude(group = "com.google.code.gson")
exclude(group = "org.slf4j")
}
implementation("com.zaxxer:HikariCP:4.0.3") { exclude(group = "org.slf4j") }
api("io.lettuce:lettuce-core:6.7.1.RELEASE") {
exclude(group = "io.netty")
exclude(group = "org.slf4j")
}
}
tasks {

View File

@@ -72,6 +72,7 @@ public class HamsterCorePlugin extends Plugin {
long start = System.currentTimeMillis();
if (CoreAPI.getInstance().isEnableRedis()) {
CoreAPI.getInstance().getJedisPool().close();
CoreAPI.getInstance().getRedisClient().close();
simpleLogger.info("已关闭 Redis 连接池");
}
if (CoreAPI.getInstance().isEnableDatabase()) {