优化节点分配逻辑,使用 edge id 固定轮换顺位;日志与 journal 集成;完善命令执行后的资源清理

This commit is contained in:
2025-08-19 11:09:58 +08:00
parent b6731f8442
commit 0c32337168
10 changed files with 75 additions and 31 deletions

View File

@@ -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)
}
}
}