⚙️ Add configurable cache time options to getSecretValue function
This commit is contained in:
@@ -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,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user