Skip to content

Commit

Permalink
fix: reconnect will crash after connection fail first time (tiny-craf…
Browse files Browse the repository at this point in the history
  • Loading branch information
tiny-craft committed Jul 11, 2024
1 parent 9bec393 commit ea8ceba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/services/browser_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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{
Expand Down

0 comments on commit ea8ceba

Please sign in to comment.