2025-05-28 20:19:11 +08:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
2025-06-06 00:09:10 +08:00
|
|
|
"game/common/constant"
|
2025-05-28 20:19:11 +08:00
|
|
|
"game/server/chat/config"
|
|
|
|
"github.com/fox/fox/db"
|
|
|
|
"github.com/fox/fox/log"
|
|
|
|
"github.com/go-redis/redis/v8"
|
|
|
|
)
|
|
|
|
|
|
|
|
var UserRedis *redis.Client
|
|
|
|
var err error
|
|
|
|
|
|
|
|
func InitRedis() {
|
2025-06-06 00:09:10 +08:00
|
|
|
UserRedis, err = db.InitRedis(config.Cfg.Redis.Password, config.Cfg.Redis.Host, config.Cfg.Redis.Port, constant.Redis1User)
|
2025-05-28 20:19:11 +08:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err.Error())
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|