|
@@ -101,16 +101,7 @@ func (h *Hub) conn() error {
|
|
|
|
|
|
// 连接测试
|
|
|
func (h *Hub) ping() error {
|
|
|
- // 连接测试
|
|
|
- conn, err := h.Get()
|
|
|
- if nil != err {
|
|
|
- return err
|
|
|
- }
|
|
|
- defer func(conn redis.Conn) {
|
|
|
- _ = conn.Close()
|
|
|
- }(conn)
|
|
|
-
|
|
|
- if reply, err := redis.String(conn.Do("PING")); err != nil || reply != "PONG" {
|
|
|
+ if reply, err := redis.String(h.Do("PING")); err != nil || reply != "PONG" {
|
|
|
if err != nil {
|
|
|
h.LOG().Warnf("Can not connect to redis: %s", err.Error())
|
|
|
} else {
|