refactor: increase cache TTL for trusted origins in admin service

This commit is contained in:
Mauricio Siu
2026-02-28 22:42:15 -06:00
parent c9e1079076
commit 096c04486c

View File

@@ -117,7 +117,7 @@ export const getDokployUrl = async () => {
return `http://${settings?.serverIp}:${process.env.PORT}`;
};
const TRUSTED_ORIGINS_CACHE_TTL_MS = 60_000;
const TRUSTED_ORIGINS_CACHE_TTL_MS = 30 * 60_000;
let trustedOriginsCache: { data: string[]; expiresAt: number } | null = null;
export const getTrustedOrigins = async () => {
@@ -132,7 +132,6 @@ export const getTrustedOrigins = async () => {
if (IS_CLOUD) {
const now = Date.now();
console.log("trustedOriginsCache", trustedOriginsCache?.data.length);
if (trustedOriginsCache && now < trustedOriginsCache.expiresAt) {
return trustedOriginsCache.data;
}