23 lines
504 B
Go
23 lines
504 B
Go
package model
|
|
|
|
import (
|
|
"game/common/constant"
|
|
"game/common/utils"
|
|
"game/server/gate/config"
|
|
"github.com/fox/fox/db"
|
|
"github.com/fox/fox/log"
|
|
"github.com/go-redis/redis/v8"
|
|
)
|
|
|
|
var UserBindServiceRedis *redis.Client
|
|
var err error
|
|
|
|
func InitRedis() {
|
|
UserBindServiceRedis, err = db.InitRedis(config.Cfg.Redis.Password, config.Cfg.Redis.Host, config.Cfg.Redis.Port, constant.Redis3UserBindService)
|
|
if err != nil {
|
|
log.Fatal(err.Error())
|
|
return
|
|
}
|
|
utils.AutoSetRedisPool(UserBindServiceRedis)
|
|
}
|