优化节点分配逻辑,使用 edge id 固定轮换顺位;日志与 journal 集成;完善命令执行后的资源清理
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package clients
|
||||
|
||||
import (
|
||||
redis "github.com/redis/go-redis/v9"
|
||||
"log/slog"
|
||||
"os"
|
||||
|
||||
redis "github.com/redis/go-redis/v9"
|
||||
)
|
||||
|
||||
var Redis *redis.Client
|
||||
@@ -29,3 +30,12 @@ func InitRedis() {
|
||||
Password: password,
|
||||
})
|
||||
}
|
||||
|
||||
func CloseRedis() {
|
||||
if Redis != nil {
|
||||
err := Redis.Close()
|
||||
if err != nil {
|
||||
slog.Error("关闭 Redis 连接失败", "error", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user