fix(api): ensure we always have profile in cache (before inserted to clickhouse)

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-08-13 20:57:42 +02:00
parent 31ccfb8b5f
commit e5cacb73df
5 changed files with 48 additions and 27 deletions

View File

@@ -87,6 +87,12 @@ export function cacheable<T extends (...args: any) => any>(
const key = getKey(...args);
return getRedisCache().del(key);
};
cachedFn.set =
(...args: Parameters<T>) =>
async (payload: Awaited<ReturnType<T>>) => {
const key = getKey(...args);
return getRedisCache().setex(key, expireInSec, JSON.stringify(payload));
};
return cachedFn;
}