⚙️ Add configurable cache time options to getSecretValue function

This commit is contained in:
2026-04-06 13:28:05 +08:00
parent b05c1bdebc
commit 349b83abb0

View File

@@ -1633,6 +1633,8 @@ export interface GetSecretValueOptions {
runEnv?: SecretValueRunEnv;
localCache?: boolean;
tryRefresh?: boolean;
defaultCacheTimeSecs?: number;
maxCacheTimeSecs?: number;
}
export function getRunEnv(): stirng | null {
@@ -1675,9 +1677,9 @@ export async function getSecretValue(
return await __getSecretValue(key, options);
},
{
tryRefresh: options.tryRefresh,
defaultCacheTimeSecs: 3600,
maxCacheTimeSecs: 3600 * 24,
tryRefresh: options?.tryRefresh,
defaultCacheTimeSecs: options?.defaultCacheTimeSecs ?? 3600,
maxCacheTimeSecs: options?.maxCacheTimeSecs ?? 3600 * 24,
},
);
}