fix: can not open connection when "CLIENT" command killed #78

This commit is contained in:
Lykin
2023-11-21 18:13:26 +08:00
parent 9aaf32e2bf
commit 30d6da85a1
2 changed files with 2 additions and 3 deletions

View File

@@ -251,6 +251,8 @@ func (b *browserService) getRedisClient(connName string, db int) (item connectio
err = fmt.Errorf("create conenction error: %s", err.Error())
return
}
_ = client.Do(b.ctx, "CLIENT", "SETNAME", url.QueryEscape(selConn.Name)).Err()
// add hook to each node in cluster mode
var cluster *redis.ClusterClient
if cluster, ok = client.(*redis.ClusterClient); ok {