chore(base-driver): Bump lru-cache
MODIFY
packages/base-driver/lib/basedriver/helpers.js
packages/base-driver/lib/basedriver/helpers.js
@@ -15,17 +15,17 @@ const ZIP_MIME_TYPES = [
'multipart/x-zip',
];
const CACHED_APPS_MAX_AGE = 1000 * 60 * 60 * 24; // ms
+const MAX_CACHED_APPS = 1024;
const APPLICATIONS_CACHE = new LRU({
- maxAge: CACHED_APPS_MAX_AGE, // expire after 24 hours
+ max: MAX_CACHED_APPS,
+ ttl: CACHED_APPS_MAX_AGE, // expire after 24 hours
updateAgeOnGet: true,
dispose: (app, {fullPath}) => {
logger.info(`The application '${app}' cached at '${fullPath}' has ` +
`expired after ${CACHED_APPS_MAX_AGE}ms`);
- setTimeout(async () => {
if (fullPath) {
- await fs.rimraf(fullPath);
+ fs.rimraf(fullPath);
}
- });
},
noDisposeOnSet: true,
});
@@ -39,7 +39,7 @@ process.on('exit', () => {
return;
}
- const appPaths = APPLICATIONS_CACHE.values()
+ const appPaths = [...APPLICATIONS_CACHE.values()]
.map(({fullPath}) => fullPath);
logger.debug(`Performing cleanup of ${appPaths.length} cached ` +
util.pluralize('application', appPaths.length));

MODIFY
packages/base-driver/lib/express/idempotency.js
packages/base-driver/lib/express/idempotency.js
@@ -20,7 +20,7 @@ const MONITORED_METHODS = ['POST', 'PATCH'];
const IDEMPOTENCY_KEY_HEADER = 'x-idempotency-key';
process.on('exit', () => {
- const resPaths = IDEMPOTENT_RESPONSES.values()
+ const resPaths = [...IDEMPOTENT_RESPONSES.values()]
.map(({response}) => response)
.filter(Boolean);
for (const resPath of resPaths) {

MODIFY
packages/base-driver/package.json
packages/base-driver/package.json
"express": "4.17.1",
"http-status-codes": "2.1.4",
"lodash": "4.17.21",
- "lru-cache": "6.0.0",
+ "lru-cache": "7.3.0",
"method-override": "3.0.0",
"morgan": "1.10.0",
"serve-favicon": "2.5.0",

chore(base-driver): Bump lru-cache (#16431)