mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-08-05 06:22:05 +00:00
feature: fetch only requested data from GitHub GraphQL API to reduce load (#3208)
* feature: fetch only requested data from GitHub GraphQL API to reduce load * dev * dev
This commit is contained in:
+6
-1
@@ -50,10 +50,15 @@ export default async (req, res) => {
|
||||
}
|
||||
|
||||
try {
|
||||
const showStats = parseArray(show);
|
||||
const stats = await fetchStats(
|
||||
username,
|
||||
parseBoolean(include_all_commits),
|
||||
parseArray(exclude_repo),
|
||||
showStats.includes("prs_merged") ||
|
||||
showStats.includes("prs_merged_percentage"),
|
||||
showStats.includes("discussions_started"),
|
||||
showStats.includes("discussions_answered"),
|
||||
);
|
||||
|
||||
let cacheSeconds = clampValue(
|
||||
@@ -96,7 +101,7 @@ export default async (req, res) => {
|
||||
locale: locale ? locale.toLowerCase() : null,
|
||||
disable_animations: parseBoolean(disable_animations),
|
||||
rank_icon,
|
||||
show: parseArray(show),
|
||||
show: showStats,
|
||||
}),
|
||||
);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user