From 349b83abb0cd14ae1324ef3583895a02b23670ad Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Mon, 6 Apr 2026 13:28:05 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20Add=20configurable=20cache?= =?UTF-8?q?=20time=20options=20to=20`getSecretValue`=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libraries/deno-commons-mod.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/deno-commons-mod.ts b/libraries/deno-commons-mod.ts index d1ee383..934f11f 100644 --- a/libraries/deno-commons-mod.ts +++ b/libraries/deno-commons-mod.ts @@ -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, }, ); }