Browse Source

specify unit for cache function

pull/2553/head
Bernd Storath 2 days ago
parent
commit
d7b1b7b9c8
  1. 2
      src/server/utils/cache.ts

2
src/server/utils/cache.ts

@ -6,7 +6,7 @@ type Opts = {
}; };
/** /**
* Cache the result of a function for the given expiry time * Cache the result of a function for the given expiry time in milliseconds
*/ */
export function cacheFunction<T>(fn: () => T, { expiry }: Opts): () => T { export function cacheFunction<T>(fn: () => T, { expiry }: Opts): () => T {
let cache: { value: T; expiry: number } | null = null; let cache: { value: T; expiry: number } | null = null;

Loading…
Cancel
Save