feat: improve deployment workflows

This commit is contained in:
2026-08-29 06:38:37 +00:00 Unverified
parent a1705487f2
commit 6ab5123f00
23 changed files with 1392 additions and 111 deletions
+8 -7
View File
@@ -41,15 +41,16 @@ export function ctx() {
return store;
}
const cache: Record<string, unknown> = {};
export function createCachedGetter<T>(
key: string,
_key: string,
fn: () => Promise<T>,
): () => Promise<T> {
return async () => {
if (key in cache) return cache[key] as T;
const result = await fn();
cache[key] = result;
return result;
let cached: Promise<T> | undefined;
return () => {
cached ??= fn().catch((error) => {
cached = undefined;
throw error;
});
return cached;
};
}