fix: key deletion operation was incomplete (#348)
This commit is contained in:
parent
aa3383db43
commit
cb428747e2
|
@ -296,6 +296,9 @@ export class RedisServerState {
|
||||||
removeKeyNode(key, isLayer) {
|
removeKeyNode(key, isLayer) {
|
||||||
if (isLayer === true) {
|
if (isLayer === true) {
|
||||||
this.deleteChildrenKeyNodes(key)
|
this.deleteChildrenKeyNodes(key)
|
||||||
|
} else {
|
||||||
|
const nodeKey = `${ConnectionType.RedisValue}/${key}`
|
||||||
|
this.nodeMap.delete(nodeKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
const dbRoot = this.getRoot()
|
const dbRoot = this.getRoot()
|
||||||
|
|
|
@ -708,17 +708,19 @@ const useBrowserStore = defineStore('browser', {
|
||||||
}
|
}
|
||||||
let match = prefix
|
let match = prefix
|
||||||
const separator = this.getSeparator(server)
|
const separator = this.getSeparator(server)
|
||||||
if (!endsWith(match, separator)) {
|
if (!isEmpty(match)) {
|
||||||
match += separator + '*'
|
if (!endsWith(match, separator)) {
|
||||||
} else {
|
match += separator + '*'
|
||||||
match += '*'
|
} else {
|
||||||
|
match += '*'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// FIXME: ignore original match pattern due to redis not support combination matching
|
// FIXME: ignore original match pattern due to redis not support combination matching
|
||||||
const { match: originMatch, type: keyType, exact } = this.getKeyFilter(server)
|
const { match: originMatch, type: keyType, exact } = this.getKeyFilter(server)
|
||||||
const { keys, maxKeys, success } = await this._loadKeys({
|
const { keys, maxKeys, success } = await this._loadKeys({
|
||||||
server,
|
server,
|
||||||
db,
|
db,
|
||||||
match: originMatch,
|
match: match || originMatch,
|
||||||
exact: false,
|
exact: false,
|
||||||
matchType: keyType,
|
matchType: keyType,
|
||||||
all: true,
|
all: true,
|
||||||
|
|
Loading…
Reference in New Issue