Skip to content

Commit

Permalink
fix: cannot get count of databases with CONFIG GET command #5 #13
Browse files Browse the repository at this point in the history
  • Loading branch information
tiny-craft committed Sep 25, 2023
1 parent e584d7f commit 47e9d90
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions backend/services/connection_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,11 @@ func (c *connectionService) OpenConnection(name string) (resp types.JSResp) {
}

// get total databases
config, err := rdb.ConfigGet(ctx, "databases").Result()
if err != nil {
resp.Msg = err.Error()
return
}
totaldb, err := strconv.Atoi(config["database"])
if err != nil {
totaldb = 16
totaldb := 16
if config, err := rdb.ConfigGet(ctx, "databases").Result(); err == nil {
if total, err := strconv.Atoi(config["databases"]); err == nil {
totaldb = total
}
}

// get database info
Expand Down

0 comments on commit 47e9d90

Please sign in to comment.