From aa8604a32b28c2024da006edce30d88ad22d8a06 Mon Sep 17 00:00:00 2001 From: Konstantin Bryzgalin Date: Fri, 14 Jun 2024 01:38:01 +0300 Subject: [PATCH] fix: setMaxParserCache throws TypeError (#2757) * fix #2752 setMaxParserCache throws TypeError --- lib/parsers/parser_cache.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/parsers/parser_cache.js b/lib/parsers/parser_cache.js index 0eb577703c..d85fabecce 100644 --- a/lib/parsers/parser_cache.js +++ b/lib/parsers/parser_cache.js @@ -2,7 +2,7 @@ const LRU = require('lru-cache').default; -const parserCache = new LRU({ +let parserCache = new LRU({ max: 15000, }); @@ -51,7 +51,7 @@ function getParser(type, fields, options, config, compiler) { } function setMaxCache(max) { - parserCache.max = max; + parserCache = new LRU({ max }); } function clearCache() {