From d86196ebda08606c2334b2ebbd6cbae8994dcbc8 Mon Sep 17 00:00:00 2001 From: hardfist Date: Mon, 6 Jan 2025 16:42:46 +0800 Subject: [PATCH] chore: limit request number (#61) --- docs/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/index.js b/docs/index.js index c8450459..c35654d6 100644 --- a/docs/index.js +++ b/docs/index.js @@ -107,7 +107,8 @@ class DataCenter { const [benchmarkName, metric] = tag.split(" + "); if (!this.cache[benchmarkName]) { this.cache[benchmarkName] = await Promise.all( - this.index[benchmarkName].map(async date => { + // only get the latest 90 days metric for performance reason + this.index[benchmarkName].slice(-180).map(async date => { const file = await fetch( `${fetchPrefix}/${date}/${benchmarkName}.json` ).then(res => res.json());