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:
parent
c1264b2dc1
commit
3eaa1f42fe
1 changed files with 3 additions and 1 deletions
4
redis.go
4
redis.go
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue