Skip to content

Commit 72fac8a

Browse files
authored
refactor: lru-cache maxAge to ttl (parse-community#8039)
1 parent 5f7d392 commit 72fac8a

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

package-lock.json

Lines changed: 13 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"jwks-rsa": "2.1.3",
4242
"ldapjs": "2.3.2",
4343
"lodash": "4.17.21",
44-
"lru-cache": "6.0.0",
44+
"lru-cache": "7.10.1",
4545
"mime": "3.0.0",
4646
"mongodb": "4.6.0",
4747
"mustache": "4.2.0",

src/Adapters/Cache/LRUCache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class LRUCache {
55
constructor({ ttl = defaults.cacheTTL, maxSize = defaults.cacheMaxSize }) {
66
this.cache = new LRU({
77
max: maxSize,
8-
maxAge: ttl,
8+
ttl,
99
});
1010
}
1111

src/LiveQuery/ParseLiveQueryServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ParseLiveQueryServer {
6464
// The main benefit is to be able to reuse the same user / session token resolution.
6565
this.authCache = new LRU({
6666
max: 500, // 500 concurrent
67-
maxAge: config.cacheTimeout,
67+
ttl: config.cacheTimeout,
6868
});
6969
// Initialize websocket server
7070
this.parseWebSocketServer = new ParseWebSocketServer(

src/LiveQuery/SessionTokenCache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SessionTokenCache {
1919
constructor(timeout: number = 30 * 24 * 60 * 60 * 1000, maxSize: number = 10000) {
2020
this.cache = new LRU({
2121
max: maxSize,
22-
maxAge: timeout,
22+
ttl: timeout,
2323
});
2424
}
2525

0 commit comments

Comments
 (0)