Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
fix: added keyPrefix redis scan
Browse files Browse the repository at this point in the history
  • Loading branch information
nkovacic committed Oct 29, 2021
1 parent 26c09ab commit b5acbfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/throttler-storage-redis.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class ThrottlerStorageRedisService implements ThrottlerStorageRedis {
}

async getRecord(key: string): Promise<number[]> {
const ttls = (await this.redis.scan(0, 'MATCH', `${key}:*`, 'COUNT', this.scanCount)).pop();
const ttls = (await this.redis.scan(0, 'MATCH', `${this.redis.options?.keyPrefix}${key}:*`, 'COUNT', this.scanCount)).pop();
return (ttls as string[]).map((k) => parseInt(k.split(':').pop())).sort();
}

Expand Down

0 comments on commit b5acbfb

Please sign in to comment.