|
@@ -11,8 +11,8 @@ func RedisClient() *redis.Client {
|
11
|
11
|
address := fmt.Sprintf("%s:%s", beego.AppConfig.String("redishost"), beego.AppConfig.String("redisport"))
|
12
|
12
|
client := redis.NewClient(&redis.Options{
|
13
|
13
|
Addr: address,
|
14
|
|
- Password: beego.AppConfig.String("redispasswrod"), // no password set
|
15
|
|
- DB: 0, // use default DB
|
|
14
|
+ Password: beego.AppConfig.String("redispasswrod"), // no password set
|
|
15
|
+ DB: beego.AppConfig.DefaultInt("redisdb", 4), // use default DB
|
16
|
16
|
})
|
17
|
17
|
pong, err := client.Ping().Result()
|
18
|
18
|
fmt.Println(pong, err)
|