From e5a797718f851e28ca430acc19b4a2f7073612cc Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Sun, 13 Oct 2024 20:45:16 -0400 Subject: [PATCH] 10 min -> 5 min content cache Took 2 minutes --- src/lib/mdx.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/mdx.ts b/src/lib/mdx.ts index 60dd198..e322553 100644 --- a/src/lib/mdx.ts +++ b/src/lib/mdx.ts @@ -31,7 +31,7 @@ const LAST_UPDATE_FILE = path.join( "docs_cache", "last_update.json" ); -const UPDATE_INTERVAL_MS: number = 10 * 60 * 1000; // 10 minutes in milliseconds +const CACHE_DURATION_MS: number = 5 * 60 * 1000; // 5 minutes in milliseconds /** * Clone the Git repository if DOCS_DIR is a URL, else use the local directory. @@ -73,7 +73,7 @@ const shouldUpdateRepo = (): boolean => { return ( Date.now() - JSON.parse(fs.readFileSync(LAST_UPDATE_FILE, "utf-8")).lastUpdate > - UPDATE_INTERVAL_MS + CACHE_DURATION_MS ); };