bilibili-backup/app/service/main/push/dao/redis.go
2019-04-22 02:59:20 +00:00

19 lines
360 B
Go

package dao
import (
"context"
"go-common/library/log"
)
// pingRedis ping redis.
func (d *Dao) pingRedis(c context.Context) (err error) {
conn := d.redis.Get(c)
defer conn.Close()
if _, err = conn.Do("SET", "PING", "PONG"); err != nil {
PromError("redis: ping remote")
log.Error("remote redis: conn.Do(SET,PING,PONG) error(%v)", err)
}
return
}