refactor: lru-cache maxAge to ttl (#8039)

This commit is contained in:
Antoine Cormouls
2022-06-13 15:29:50 +02:00
committed by GitHub
parent 5f7d392a06
commit 72fac8a5fc
5 changed files with 17 additions and 10 deletions

View File

@@ -64,7 +64,7 @@ class ParseLiveQueryServer {
// The main benefit is to be able to reuse the same user / session token resolution.
this.authCache = new LRU({
max: 500, // 500 concurrent
maxAge: config.cacheTimeout,
ttl: config.cacheTimeout,
});
// Initialize websocket server
this.parseWebSocketServer = new ParseWebSocketServer(

View File

@@ -19,7 +19,7 @@ class SessionTokenCache {
constructor(timeout: number = 30 * 24 * 60 * 60 * 1000, maxSize: number = 10000) {
this.cache = new LRU({
max: maxSize,
maxAge: timeout,
ttl: timeout,
});
}