fix: connection not release after failure

This commit is contained in:
Lykin 2024-01-20 17:59:51 +08:00
parent 74ab68b280
commit e3e0ed0a91
1 changed files with 3 additions and 0 deletions

View File

@ -319,6 +319,9 @@ func (b *browserService) getRedisClient(server string, db int) (item *connection
var connConfig = selConn.ConnectionConfig var connConfig = selConn.ConnectionConfig
connConfig.LastDB = db connConfig.LastDB = db
client, err = b.createRedisClient(connConfig) client, err = b.createRedisClient(connConfig)
if err != nil {
return
}
ctx, cancelFunc := context.WithCancel(b.ctx) ctx, cancelFunc := context.WithCancel(b.ctx)
item = &connectionItem{ item = &connectionItem{
client: client, client: client,