We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b026a7 commit 3cd9918Copy full SHA for 3cd9918
storages/lru-redis/src/LRUWithRedisStorage.ts
@@ -4,13 +4,19 @@ import * as LRU from "lru-cache";
4
import * as Redis from "ioredis";
5
6
export class LRUWithRedisStorage implements AsynchronousCacheType {
7
- myCache: LRU<string, any>;
+ private myCache: LRU<string, any>;
8
+ private options: LRU.Options<string, any>;
9
10
constructor(
- private options: LRU.Options<string, any>,
11
+ options: LRU.Options<string, any>,
12
private redis: () => Redis.Redis
13
) {
- this.myCache = new LRU(options);
14
+ this.options = {
15
+ max: 500,
16
+ maxAge: 86400,
17
+ ...options
18
+ }
19
+ this.myCache = new LRU(this.options);
20
}
21
22
public async getItem<T>(key: string): Promise<T | undefined> {
0 commit comments