You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
360 B
18 lines
360 B
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 |
|
}
|
|
|