⚙️ Add configurable cache time options to getSecretValue function
This commit is contained in:
@@ -1633,6 +1633,8 @@ export interface GetSecretValueOptions {
|
|||||||
runEnv?: SecretValueRunEnv;
|
runEnv?: SecretValueRunEnv;
|
||||||
localCache?: boolean;
|
localCache?: boolean;
|
||||||
tryRefresh?: boolean;
|
tryRefresh?: boolean;
|
||||||
|
defaultCacheTimeSecs?: number;
|
||||||
|
maxCacheTimeSecs?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getRunEnv(): stirng | null {
|
export function getRunEnv(): stirng | null {
|
||||||
@@ -1675,9 +1677,9 @@ export async function getSecretValue(
|
|||||||
return await __getSecretValue(key, options);
|
return await __getSecretValue(key, options);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tryRefresh: options.tryRefresh,
|
tryRefresh: options?.tryRefresh,
|
||||||
defaultCacheTimeSecs: 3600,
|
defaultCacheTimeSecs: options?.defaultCacheTimeSecs ?? 3600,
|
||||||
maxCacheTimeSecs: 3600 * 24,
|
maxCacheTimeSecs: options?.maxCacheTimeSecs ?? 3600 * 24,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user