mirror of
https://github.com/pgsty/minio.git
synced 2026-08-02 16:45:57 +03:00
Implement CLIENT SETNAME for Redis connections (#9876)
Add note about CLIENT SETNAME needing auth
This commit is contained in:
committed by
Harshavardhana
parent
0513ac72ff
commit
98ac2c452a
@@ -267,11 +267,17 @@ func NewRedisTarget(id string, args RedisArgs, doneCh <-chan struct{}, loggerOnc
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if args.Password == "" {
|
if args.Password != "" {
|
||||||
return conn, nil
|
if _, err = conn.Do("AUTH", args.Password); err != nil {
|
||||||
|
cErr := conn.Close()
|
||||||
|
targetID := event.TargetID{ID: id, Name: "redis"}
|
||||||
|
loggerOnce(context.Background(), cErr, targetID)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err = conn.Do("AUTH", args.Password); err != nil {
|
// Must be done after AUTH
|
||||||
|
if _, err = conn.Do("CLIENT", "SETNAME", "MinIO"); err != nil {
|
||||||
cErr := conn.Close()
|
cErr := conn.Close()
|
||||||
targetID := event.TargetID{ID: id, Name: "redis"}
|
targetID := event.TargetID{ID: id, Name: "redis"}
|
||||||
loggerOnce(context.Background(), cErr, targetID)
|
loggerOnce(context.Background(), cErr, targetID)
|
||||||
|
|||||||
Reference in New Issue
Block a user