Skip to content

Commit

Permalink
add default value to count
Browse files Browse the repository at this point in the history
  • Loading branch information
noamilshtein committed Dec 21, 2023
1 parent 651216a commit b8a1290
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class buildRedisStoreWithConfig implements RedisStore {
return await this.redisCache.ttl(key);
};

public async scan(pattern: string, cursor: number = 0, count?: number): Promise<ScanReply> {
public async scan(pattern: string, cursor: number = 0, count: number = 10): Promise<ScanReply> {
return await this.redisCache.scan(cursor, { MATCH: pattern, COUNT: count });
}

Expand Down
2 changes: 1 addition & 1 deletion test/redis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('Redis Store', () => {
await redisClient.set(key2, value, ttl);
await redisClient.set(key3, value, ttl);

const res = await redisClient.scan('ttl:a:*', 0, 10);
const res = await redisClient.scan('ttl:a:*');
expect(res.keys).toEqual([key1, key3]);

const firstScanWithCount = await redisClient.scan('ttl:a:*', 0, 1);
Expand Down

0 comments on commit b8a1290

Please sign in to comment.