Skip to content
This repository was archived by the owner on May 23, 2022. It is now read-only.

fix: catch config get command renamed #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"${workspaceFolder}/out/**/*.js"
],
"args": [
// "--disable-extensions",
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}"
]
}
Expand Down
11 changes: 7 additions & 4 deletions src/server/tree/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ export default class RedisItem extends Element {
async getChildren(): Promise<Element[]> {
await this.connect();
this.client.options.reconnection = true;
const [keyspaceStr, info] = await Promise.all([
this.client.INFO('keyspace'),
this.client.CONFIG('get', 'databases')
]);

const keyspaceStr = await this.client.INFO('keyspace');
const keyspace = this.parseKeyspace(keyspaceStr);
let info = ['databases', Object.keys(keyspace).length];
try {
info = await this.client.CONFIG('get', 'databases');
} catch (e) {
// ignore
}
const count = parseInt(info[1] as string);
const result: DBItem[] = [];
for (let i = 0; i < count; i++) {
Expand Down
Binary file added vscode-redis.vsix
Binary file not shown.