fix: cannot get count of databases with CONFIG GET command #5 #13

This commit is contained in:
tiny-craft 2023-09-26 00:57:20 +08:00
parent e584d7f078
commit 47e9d908e7
1 changed files with 5 additions and 8 deletions

View File

@ -183,14 +183,11 @@ func (c *connectionService) OpenConnection(name string) (resp types.JSResp) {
} }
// get total databases // get total databases
config, err := rdb.ConfigGet(ctx, "databases").Result() totaldb := 16
if err != nil { if config, err := rdb.ConfigGet(ctx, "databases").Result(); err == nil {
resp.Msg = err.Error() if total, err := strconv.Atoi(config["databases"]); err == nil {
return totaldb = total
} }
totaldb, err := strconv.Atoi(config["database"])
if err != nil {
totaldb = 16
} }
// get database info // get database info