This commit is contained in:
Andrew Pennington 2024-08-15 23:51:53 +01:00
parent 779c6749ff
commit d1e382831c
No known key found for this signature in database
GPG key ID: E9DA097213FD17EA

View file

@ -23,7 +23,7 @@ async function fetchConfig() {
}
}
export async function getServerEnv(envVar: string): Promise<string> {
export async function getServerEnv(envVar: string): Promise<string | undefined> {
// Check if the cache is still valid
if (cachedConfig && cacheTimestamp && Date.now() - cacheTimestamp < CACHE_DURATION_MS) {
return cachedConfig[envVar] || process.env[envVar];