File tree 2 files changed +5
-7
lines changed
2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const LRU = require ( 'lru-cache' )
4
4
5
- const MAX_SIZE = 50 * 1024 * 1024 // 50MB
6
- const MAX_AGE = 3 * 60 * 1000
7
-
8
5
const MEMOIZED = new LRU ( {
9
- max : MAX_SIZE ,
10
- maxAge : MAX_AGE ,
11
- length : ( entry , key ) => key . startsWith ( 'key:' ) ? entry . data . length : entry . length ,
6
+ max : 500 ,
7
+ maxSize : 50 * 1024 * 1024 , // 50MB
8
+ ttl : 3 * 60 * 1000 , // 3 minutes
9
+ sizeCalculation : ( entry , key ) => key . startsWith ( 'key:' ) ? entry . data . length : entry . length ,
12
10
} )
13
11
14
12
module . exports . clearMemoized = clearMemoized
Original file line number Diff line number Diff line change 52
52
"fs-minipass" : " ^2.1.0" ,
53
53
"glob" : " ^7.1.4" ,
54
54
"infer-owner" : " ^1.0.4" ,
55
- "lru-cache" : " ^6.0.0 " ,
55
+ "lru-cache" : " ^7.5.1 " ,
56
56
"minipass" : " ^3.1.6" ,
57
57
"minipass-collect" : " ^1.0.2" ,
58
58
"minipass-flush" : " ^1.0.5" ,
You can’t perform that action at this time.
0 commit comments