1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-17 04:30:03 +02:00

redis.go: in RedisConnect() do a ping and return any errors. So we know that the connection is up or not.

This commit is contained in:
Henrik Hautakoski 2022-02-02 15:58:06 +01:00
parent c1264b2dc1
commit 3eaa1f42fe

View file

@ -14,12 +14,14 @@ var redisCtx = context.Background()
var redisPrefix = "ship."
func RedisConnect(addr string, password string, db int) {
func RedisConnect(addr string, password string, db int) error {
rdb = redis.NewClient(&redis.Options{
Addr: addr,
Password: password,
DB: db,
})
return rdb.Ping(redisCtx).Err()
}
func RedisKey(components ...string) (string) {