Merge branch 'technical-improvements' into user-management

This commit is contained in:
martin-mfg
2025-09-09 19:24:44 +02:00
21 changed files with 461 additions and 487 deletions
+5 -3
View File
@@ -1,6 +1,7 @@
import { renderTopLanguages } from "../src/cards/top-languages.js";
import { blacklist } from "../src/common/blacklist.js";
import {
clampValue,
CONSTANTS,
parseArray,
parseBoolean,
@@ -73,9 +74,10 @@ export default async (req, res) => {
parseArray(role),
);
let cacheSeconds = parseInt(
cache_seconds || CONSTANTS.TOP_LANGS_CACHE_SECONDS,
10,
let cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TOP_LANGS_CACHE_SECONDS, 10),
CONSTANTS.FOUR_HOURS,
CONSTANTS.TEN_DAY,
);
cacheSeconds = process.env.CACHE_SECONDS
? parseInt(process.env.CACHE_SECONDS, 10) || cacheSeconds