webdis add prefix in scan

This commit is contained in:
fyears 2024-07-28 15:50:01 +08:00
parent d42b31cea2
commit b5099854af

View File

@ -117,7 +117,7 @@ export class FakeFsWebdis extends FakeFs {
let cursor = "0"; let cursor = "0";
const res: Entity[] = []; const res: Entity[] = [];
do { do {
const command = `SCAN/${cursor}/MATCH/rs:fs:v1:*:meta/COUNT/1000`; const command = `SCAN/${cursor}/MATCH/rs:fs:v1:${encodeURIComponent(this.remoteBaseDir + "/")}*:meta/COUNT/1000`;
const rsp = (await (await this._fetchCommand("GET", command)).json())[ const rsp = (await (await this._fetchCommand("GET", command)).json())[
"SCAN" "SCAN"
]; ];
@ -136,7 +136,7 @@ export class FakeFsWebdis extends FakeFs {
async walkPartial(): Promise<Entity[]> { async walkPartial(): Promise<Entity[]> {
let cursor = "0"; let cursor = "0";
const res: Entity[] = []; const res: Entity[] = [];
const command = `SCAN/${cursor}/MATCH/rs:fs:v1:*:meta/COUNT/10`; // fewer keys const command = `SCAN/${cursor}/MATCH/rs:fs:v1:${encodeURIComponent(this.remoteBaseDir + "/")}*:meta/COUNT/10`; // fewer keys
const rsp = (await (await this._fetchCommand("GET", command)).json())[ const rsp = (await (await this._fetchCommand("GET", command)).json())[
"SCAN" "SCAN"
]; ];