From b714e01aba47b9d58ed83aa693dc0104273b40f1 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Mon, 4 Nov 2024 18:55:50 +0900 Subject: [PATCH] Implement cache size limit for script caching --- src/ts/process/scripts.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ts/process/scripts.ts b/src/ts/process/scripts.ts index f7e7e2e5..1f126ccb 100644 --- a/src/ts/process/scripts.ts +++ b/src/ts/process/scripts.ts @@ -75,6 +75,10 @@ function cacheScript(scripts:customscript[], data:string, result:string){ processScriptCache.set(hash, result) + if(processScriptCache.size > 500){ + processScriptCache.delete(processScriptCache.keys().next().value) + } + } function getScriptCache(scripts:customscript[], data:string){