mirror of
https://github.com/tiny-craft/tiny-rdm.git
synced 2025-04-22 05:18:04 +08:00
fix: reconnect will crash after connection fail first time (#301)
This commit is contained in:
parent
9bec3934bb
commit
ea8ceba32a
@ -325,6 +325,7 @@ func (b *browserService) getRedisClient(server string, db int) (item *connection
|
||||
selConn := Connection().getConnection(server)
|
||||
if selConn == nil {
|
||||
err = fmt.Errorf("no match connection \"%s\"", server)
|
||||
delete(b.connMap, server)
|
||||
return
|
||||
}
|
||||
|
||||
@ -337,6 +338,7 @@ func (b *browserService) getRedisClient(server string, db int) (item *connection
|
||||
connConfig.LastDB = db
|
||||
client, err = b.createRedisClient(ctx, connConfig)
|
||||
if err != nil {
|
||||
delete(b.connMap, server)
|
||||
return
|
||||
}
|
||||
item = &connectionItem{
|
||||
|
Loading…
x
Reference in New Issue
Block a user