fix: no db loaded (#353)
This commit is contained in:
parent
a70b5b56ff
commit
026591c8d4
|
@ -166,7 +166,7 @@ func (b *browserService) OpenConnection(name string) (resp types.JSResp) {
|
|||
|
||||
if totaldb <= 0 {
|
||||
// cannot retrieve the database count by "CONFIG GET databases", try to get max index from keyspace
|
||||
if keyspace := info["Keyspace"]; len(keyspace) > 0 {
|
||||
keyspace := info["Keyspace"]
|
||||
var db, maxDB int
|
||||
for dbName := range keyspace {
|
||||
if db, err = strconv.Atoi(strings.TrimLeft(dbName, "db")); err == nil {
|
||||
|
@ -177,7 +177,6 @@ func (b *browserService) OpenConnection(name string) (resp types.JSResp) {
|
|||
}
|
||||
totaldb = maxDB + 1
|
||||
}
|
||||
}
|
||||
|
||||
queryDB := func(idx int) types.ConnectionDB {
|
||||
dbName := "db" + strconv.Itoa(idx)
|
||||
|
|
Loading…
Reference in New Issue