Skip to content

Commit

Permalink
处理Keyspace信息为空的场景
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo committed Jul 10, 2022
1 parent 082e2fe commit 1d84467
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql/engines/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_all_databases(self, **kwargs):
except Exception as e:
logger.warning(f"Redis CONFIG GET databases 执行报错,异常信息:{e}")
dbs = [int(i.split('db')[1]) for i in conn.info('Keyspace').keys() if len(i.split('db')) == 2]
rows = max(16, max(dbs))
rows = max(dbs, [16])

db_list = [str(x) for x in range(int(rows))]
result.rows = db_list
Expand Down

0 comments on commit 1d84467

Please sign in to comment.